How to get the ip addresses of a nic

Justin Dubs jtdubs at eos.ncsu.edu
Wed Apr 21 22:25:08 EDT 2004


"Bo Jacobsen" <bo at systemhouse.dk> wrote in message news:<LEfhc.146586$jf4.7761132 at news000.worldonline.dk>...
> Is there a simple way to get all the ip addresses of a nic, beyound parsing
> /etc/sysconfig/.....

Depending on your needs:

>>> socket.gethostbyname(socket.gethostname())
'192.168.0.18'

Justin Dubs



More information about the Python-list mailing list