1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-25 10:42:28 +00:00
gists/repos/b21443fe1d57fdfe0fe2f79827be3551/hostname.py

7 lines
157 B
Python
Raw Normal View History

2018-07-25 17:24:48 +00:00
try:
import urllib2
except ImportError:
from urllib.request import urlopen
response = urlopen('http://v4.ifconfig.co/ip')
HOSTNAME = response.read()