IP Address Function

Chris Rebert clp2 at rebertia.com
Tue Jul 7 21:09:09 EDT 2009


On Tue, Jul 7, 2009 at 6:45 PM, Fred Atkinson<fatkinson at mishmash.com> wrote:
>        Is there a Python function I can use to get the user's IP
> address so I can display it on his browser?

from socket import gethostname, gethostbyname
ip = gethostbyname(gethostname())

Cheers,
Chris
-- 
http://blog.rebertia.com



More information about the Python-list mailing list