Skip to content

Instantly share code, notes, and snippets.

@tjmichael81
Created May 7, 2014 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjmichael81/5fb2db28a61035339a19 to your computer and use it in GitHub Desktop.
Save tjmichael81/5fb2db28a61035339a19 to your computer and use it in GitHub Desktop.
Get public IP address with Python
import urllib
import json
conn = urllib.urlopen('http://httpbin.org/ip')
print json.load(conn)['origin']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment