{"id":12076,"date":"2022-03-16T04:42:41","date_gmt":"2022-03-16T08:42:41","guid":{"rendered":"http:\/\/local.brightwhiz\/?post_type=snippets&p=12076"},"modified":"2022-03-16T04:42:44","modified_gmt":"2022-03-16T08:42:44","slug":"python-get-public-ip-address","status":"publish","type":"snippets","link":"http:\/\/local.brightwhiz\/snippets\/python-get-public-ip-address\/","title":{"rendered":"Python get Public IP Address"},"content":{"rendered":"\n
Python get public ip address example. This example requires the requests library to be installed.<\/p>\n\n\n\n
from requests import get\n\nip = get('http:\/\/local.brightwhiz').text\nprint(f'My public IP address is: {ip}')<\/code><\/pre>\n\n\n\nMore about the Requests library here: http:\/\/docs.python-requests.org\/en\/latest\/<\/a><\/p>\n","protected":false},"comment_status":"open","ping_status":"closed","template":"","meta":[],"categories":[953,27,15,16,18],"tags":[],"yoast_head":"\nPython get Public IP Address [Snippets]<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n