[Tutor] need a way to get my own ip address

jay titleistfour at gmail.com
Wed Jan 2 15:31:39 CET 2008


You could perhaps use this method

import socket
myIP = socket.gethostbyaddr(socket.gethostname())[2]

Jay

On Jan 2, 2008 8:25 AM, shawn bright <nephish at gmail.com> wrote:

> Greetings,
>
> i am looking for an easy way to get my own ip address as a string from
> python.
> I am using Ubuntu Linux if that makes any difference.
> thanks !
>
> shawn
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080102/be652078/attachment.htm 


More information about the Tutor mailing list