determine IP

exarkun at divmod.com exarkun at divmod.com
Sun Nov 7 11:04:36 EST 2004


On Sun, 07 Nov 2004 15:52:42 +0000, Keir Lawson <keir at thelawsons.plus.com> wrote:
>is there a cross platform way to determine a local machines IP on a
> network (LAN or internet) in python?
> 

    s = socket.socket()
    s.connect(('google.com', 80))
    print s.getsockname()

  Jp




More information about the Python-list mailing list