我的IP地址,国家/地区和计数输出以随机垂直方式显示。这是我的打印代码:
print "Source IP\t\t\tCountry\t\t\tCode\t\t\tCount"
for ip, count in non_base_10_ip:
print "{0}\t\t\t\t\t\t\t\t\t{1}\t\t\t\t\t\t\t\t\t{2}\t\t\t\t\t\t\t\t\t{3}".format(ip,gi.country_name_by_addr(ip),gi.country_code_by_addr(ip), count)+ "\r"
for base10ip,count in base_10_ip:
print "{0}\t\t\t\t\t{1}\t\t\t\t\t{2}\t\t\t\t\t{3}".format(base10ip,gi.country_name_by_addr(base10ip),gi.country_code_by_addr(base10ip), count)+ "\r"
但我的输出显示如下:
115.237.36.185 China CN 2
185.35.62.206 Switzerland CH 2
74.82.47.34 United States US 2
114.149.150.237 Japan