[Tutor] Finding all IP addresses associated with a host

Scott Newton scott.newton at gmail.com
Fri Apr 10 07:41:14 CEST 2009


Thanks, not sure how I missed that one.

-Scott

On Thu, Apr 9, 2009 at 7:25 PM, Emile van Sebille <emile at fenx.com> wrote:

> Scott Newton wrote:
>
>> I'm very new to python, and my google-fu has failed to locate an answer to
>> the following:
>>
>> How can I find all of the (ipv4) addresses that are currently up on a
>> host?
>>
>
>
> In google I searched for "python what's my ip" and about the fourth entry
> down found a link that led me to http://pypi.python.org/pypi/netifaces/0.3
>
> How far does that get you?
>
> HTH,
>
> Emile
>
>
>
>
>> I realize I can call ifconfig and then munge the output with awk, but that
>> seems messy, and before I tried that I though I would ask around.
>>
>> To give a bit more information, I'm writing a script that will use the ip
>> address assigned to the wifi interface to determine location (this is on a
>> Mac) and then mount network drives appropriate to the location. If anyone
>> has a better idea how to do this, I'd be happy to hear them.
>>
>> Thanks in advance!
>>
>> Scott Newton
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090410/e8ea2c0c/attachment.htm>


More information about the Tutor mailing list