[Tutor] [tutor] ipconfig

andrew clarke mail at ozzmosis.com
Thu Aug 10 16:01:40 CEST 2006


On Thu, Aug 10, 2006 at 04:47:43PM +0300, emilia12 at mail.bg wrote:

> is there in python an independent from the system way to obtain the IP

>>> import socket
>>> hostname = socket.gethostname()
>>> ip = socket.gethostbyname(hostname)
>>> print ip
192.168.1.10


More information about the Tutor mailing list