123456789101112131415161718192021222324252627282930313233343536373839 |
- # ratioHash = {}
- # sampleHash = {}
- #
- # sip = "sara"
- # posA = 'alexandra'
- #
- # connection = [1,1]
- #
- # print 10/5
- #
- # for i in range (0, 2):
- # if sip in ratioHash:
- # sampleHash[posA][0]+=connection[0]
- # sampleHash[posA][1]+= connection[1]
- # else:
- # sampleHash[posA] = [connection[0], connection[1]]
- # ratioHash[sip] = sampleHash
- # #print (posA
- #
- # print ratioHash
- #
- # import json
- # #PATH = '/Users/Sara/Documents/Univ Classes/Investigacion/Programas/newFlow.txt'
- # PATH = '/mnt/c/Users/Sara/Documents/Univ Classes/Investigacion/Programas/newFlow.txt'
- #
- # myFile = open(PATH, 'r')
- # ip = myFile.read()
- # flow = json.loads(ip)
- #
- # for i in flow['flows']:
- # flags = i["tcpflags"].split(",")
- # print flags[0]
- hashi = {}
- if 'hola' in hashi:
- hashi['hola'][0]+= 1
- else:
- hashi = {'hola': [0, 1]}
-
- print hashi['hola']
|