Created
September 23, 2024 20:45
-
-
Save Frank-Buss/d07297c5cca2faf290d34b3f60a24250 to your computer and use it in GitHub Desktop.
get your IP address
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
#!/usr/bin/env python3 | |
import requests | |
response = requests.get("https://httpbin.org/ip") | |
data = response.json() | |
ip = data.get("origin", "Unknown") | |
print(f"Your IP address is: {ip}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment