Last active
May 6, 2022 03:44
-
-
Save AJ-Acevedo/766c7dbbe1b3dd828ed2c043cc6ce107 to your computer and use it in GitHub Desktop.
A Python 3 script to display your external 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 | |
# PyIP | |
# Author: AJ Acevedo | |
# Description: A Python 3 script to display your external IP address | |
# This could also be achived using curl on the CLI | |
# curl https://ipecho.net/plain | |
# Requests: https://docs.python-requests.org/en/latest/ | |
# Version 0.1 | |
import requests | |
url = 'https://ipecho.net/plain' | |
ip = requests.get(url) | |
print(ip.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment