1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-22 17:52:27 +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()