mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-24 04:21:12 +00:00
13 lines
313 B
Python
13 lines
313 B
Python
from urllib.request import urlopen
|
|
|
|
url = "http://checkip.dyndns.org"
|
|
|
|
print("Making request to " + url + "...")
|
|
request = urlopen(url)
|
|
|
|
print("Reading the response...")
|
|
response = request.read()
|
|
|
|
print("Extracting your IP info...")
|
|
ip = ">>> " + response.decode("utf-8").split("body")[1][1:-2] + " <<<"
|
|
print(ip) |