Personal tools
You are here: Home Knowledge Get public IP from behind a router (in Python)
Document Actions

Get public IP from behind a router (in Python)

by David Convent last modified 2009-06-16 22:00

Get my IP from the internet (needed if behing a router)

This is the simplest way that I could find:

>>> import urllib2
>>> urllib2.urlopen('http://whatismyip.org').read()
'www.xxx.yyy.zzz'

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: