From c3f90fc23787e53f8c2f2aafa9ac1d5880fb01ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Wed, 25 Jul 2018 19:24:48 +0200 Subject: [PATCH] --- hostname.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 hostname.py diff --git a/hostname.py b/hostname.py new file mode 100644 index 0000000..90428c9 --- /dev/null +++ b/hostname.py @@ -0,0 +1,6 @@ +try: + import urllib2 +except ImportError: + from urllib.request import urlopen +response = urlopen('http://v4.ifconfig.co/ip') +HOSTNAME = response.read()