Skip to content

Instantly share code, notes, and snippets.

@AJ-Acevedo
Last active May 6, 2022 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AJ-Acevedo/766c7dbbe1b3dd828ed2c043cc6ce107 to your computer and use it in GitHub Desktop.
Save AJ-Acevedo/766c7dbbe1b3dd828ed2c043cc6ce107 to your computer and use it in GitHub Desktop.
A Python 3 script to display your external IP address
#!/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