Last active
November 30, 2017 10:32
-
-
Save Gilinho/b2728cf674c93709ec60178a370bd06e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, json | |
data = json.loads(urllib.urlopen("http://ip.jsontest.com/").read()) | |
print data["ip"] | |
#OR Without json | |
# | |
#import urllib, re | |
# | |
#data = re.search('"([0-9.]*)"', urllib.urlopen("http://ip.jsontest.com/").read()).group(1) | |
#print data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment