[Tutor] IP Address

Stuart Smith stuart@sharedreality.org
Wed, 22 May 2002 19:27:39 +0100


Take a look at the socket module.  More specifically, try this:

from socket import *
gethostbyname(gethostname())

gethostbyname returns an IP address given a hostname... gethostname returns 
the name of the local machine.

--
Stuart Smith

At 11:15 22/05/2002 -0700, you wrote:
>I would like to make a script that Would FTP Post my
>home computer's IP address to my homepage.  However I
>just cannot figure out how to get the IP i've looked
>over the Module reference.  I am just not seeing it.