python-scripts/scripts/Public_IP_Address/my_public_ip.py

5 lines
129 B
Python
Raw Normal View History

2022-10-01 04:26:37 +00:00
from requests import get
2022-09-16 17:59:42 +00:00
2022-10-01 04:26:37 +00:00
ip = get('https://ipv4.icanhazip.com').text
2022-09-16 17:59:42 +00:00
2022-10-01 04:26:37 +00:00
print('>>> My public IP address is: ' + ip[0:-1] + ' <<<')