get the IP address of a host

Nick Coghlan ncoghlan at
Thu Jan 6 14:51:23 CET 2005

J Berends wrote:
> Lee Harr wrote:
>> Basically, it scrapes the output from ifconfig for the
>> actual address assigned to the interface. Works perfectly
>> on FreeBSD and Linux (given the correct configuration).
> Nice way, have to device something for windows than.

Use the same approach, but scrape the output of ipconfig instead. Use subprocess 
to run the command in Python 2.4, or work something out with one of the popen 
variants for earlier versions.


Nick Coghlan   |   ncoghlan at   |   Brisbane, Australia

More information about the Python-list mailing list