Last active
December 2, 2018 12:47
-
-
Save etzl/33b98cdbcc9b53396e6a27f4297e17ff to your computer and use it in GitHub Desktop.
Get public ip and show in terminal using python with no extera package needed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
response = requests.get("https://httpbin.org/ip") | |
print(response.json()['origin']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was looking for a method i get public IP without browsing internet i found this code with python doing this easy, I'm sharing for those who need it and check
help(requests)
andhelp(str)
out for more information. 👌Requirements:
pip install requests