Nov-14-2018, 04:45 PM
Hi!
I found a script online that uses the website ipinfo.io to deliver some information about the users IP adress. I'm trying to figure out what this line means:
Thanks a lot in advance.
I found a script online that uses the website ipinfo.io to deliver some information about the users IP adress. I'm trying to figure out what this line means:
print ('IP : {4} \nRegion : {1} \nCountry : {2} \nCity : {3} \nOrg : {0}'.format(org,region,country,city,IP))In context of this here script:
import re import json from urllib.request import urlopen url = 'http://ipinfo.io/json' response = urlopen(url) data = json.load(response) IP=data['ip'] org=data['org'] city = data['city'] country=data['country'] region=data['region'] print ('Your IP detail\n ') print ('IP : {4} \nRegion : {1} \nCountry : {2} \nCity : {3} \nOrg : {0}'.format(org,region,country,city,IP))Specifically, what exactly do the numbers represent inbetween the variables? How does the .format do its thing?
Thanks a lot in advance.