Skip to content

Instantly share code, notes, and snippets.

@balkian
Created July 25, 2018 17:24
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 balkian/b21443fe1d57fdfe0fe2f79827be3551 to your computer and use it in GitHub Desktop.
Save balkian/b21443fe1d57fdfe0fe2f79827be3551 to your computer and use it in GitHub Desktop.
try:
import urllib2
except ImportError:
from urllib.request import urlopen
response = urlopen('http://v4.ifconfig.co/ip')
HOSTNAME = response.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment