blob: 4128adecbdd8da0545f9255b854d4b54e7870eff (
plain)
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
|
import json
from pprint import pprint
from sortedcontainers import SortedDict
f = open('list02', 'r')
d = {}
f2 = open('output', 'r')
d2 = SortedDict(json.loads(f2.read()))
for line in f.readlines():
tmp = line.strip('\n').split('|')
if len(tmp) == 3:
if tmp[1].strip(' ') in d:
if d[tmp[1].strip(' ')] != (tmp[0].strip(' '), tmp[2].strip(' ')):
# print d[tmp[1].strip(' ')], (tmp[0].strip(' '), tmp[2].strip(' '))
print tmp[1].strip(' '), tmp[0].strip(' ')
d[tmp[1].strip(' ')] = (tmp[0].strip(' '), tmp[2].strip(' '))
# for tld in d2:
# for host in d2[tld]:
# print tld, d[d2[tld][host][0]][1]
#
# for i in d:
# print d[i]
|