Skip to content

Instantly share code, notes, and snippets.

@Frank-Buss
Created September 23, 2024 20:45
Show Gist options
  • Save Frank-Buss/d07297c5cca2faf290d34b3f60a24250 to your computer and use it in GitHub Desktop.
Save Frank-Buss/d07297c5cca2faf290d34b3f60a24250 to your computer and use it in GitHub Desktop.
get your IP address
#!/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