pretty print
This commit is contained in:
parent
1f7ae3959c
commit
dd9b0c60d3
2
ip.py
2
ip.py
@ -18,7 +18,7 @@ def main():
|
|||||||
gi = pygeoip.GeoIP('GeoLiteCity.dat')
|
gi = pygeoip.GeoIP('GeoLiteCity.dat')
|
||||||
geo_info = gi.record_by_addr(client_ip)
|
geo_info = gi.record_by_addr(client_ip)
|
||||||
geo_info['ip'] = client_ip
|
geo_info['ip'] = client_ip
|
||||||
print(json.dumps(geo_info))
|
print(json.dumps(geo_info, indent=2))
|
||||||
else:
|
else:
|
||||||
print(client_ip)
|
print(client_ip)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user