-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathczyszczenieTab.py
46 lines (39 loc) · 1.08 KB
/
czyszczenieTab.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def duplic_index(seq,item):
start_at = -1
locs = []
while True:
try:
loc = seq.index(item,start_at+1)
except ValueError:
break
else:
locs.append(loc)
start_at = loc
return locs
file = open("HashTablicaExported_.txt","r")
HashTabStr = []
HashTabHa = []
for Line in file:
fString = Line[0:8]
fHash = Line[9:-1]
HashTabStr.append(fString)
HashTabHa.append(fHash)
file.close()
#indexy = []
#for y in HashTabHa:
# print(" - ") #DEBUG ONLY
# indexy = duplic_index( fHash, y )
# if len(indexy) > 1:
# del indexy[0]
# for x in range(len(indexy)):
# HashTabHa.pop(x)
# HashTabStr.pop(x)
# #for i in range(len(HashTabHa)):
# # pass
HashTabStr2 = list(dict.fromkeys(HashTabStr))
HashTabHa2 = list(dict.fromkeys(HashTabHa))
file2 = open("HashTablicaSkrocone.txt","x")
for i in range(len(HashTabHa2)):
dowpisania = "" + HashTabStr2[i] + " " + HashTabHa2[i] + "\n"
file2.write( dowpisania )
file2.close()