Python to tell what is the IP of my PC .

Nicolas G nicolasg at
Thu Nov 9 01:18:34 CET 2006

On 11/9/06, Tim Williams <tim at> wrote:
> On 8 Nov 2006 15:35:31 -0800, NicolasG <nicolasg at> wrote:
> > How can I use python to get the real IP address of my DSL router (when
> > my PC is part of the local home LAN) ?
> The router will the PC's default gateway IP address,  if you are on a
> windows platform,  you can view it by typing IPCONFIG (enter) from a
> command prompt.

This is the  router local IP, I need to get the router "outside" IP witch is
the real one.

A quick google, gave me this,  look at the comments at the end for an
> example of finding the Default Gateway IP address using Python

import win32api raise the error "module not exsit"

the router doesn't have a hostname.

cheers ;)

Nicolas G

Skype: nicolasg_
mobile: +30 69 45 714 578
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list