for each in cursor fetchall login segment name street bnum apart each

1
2
3
4
5
6
7
8
9
for each in cursor.fetchall():
login,segment,name,street,bnum,apart = each
if bin2ip(segment).startswith('192.168.33.'):
continue
elif bin2ip(segment).startswith('195.22.105.') and int(bin2ip(segment).split('.')[-1]) > 100:
continue
else:
output = login + ";" + bin2ip(segment) + ";" + name + ";" + street + " " + bnum + "-" + apart
print output.encode('utf8')