Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5421 > unrolled thread

Re: Get the IP address of WIFI interface

Started byTim Golden <mail@timgolden.me.uk>
First post2011-05-15 12:12 +0100
Last post2011-05-15 12:12 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Get the IP address of WIFI interface Tim Golden <mail@timgolden.me.uk> - 2011-05-15 12:12 +0100

#5421 — Re: Get the IP address of WIFI interface

FromTim Golden <mail@timgolden.me.uk>
Date2011-05-15 12:12 +0100
SubjectRe: Get the IP address of WIFI interface
Message-ID<mailman.1592.1305457939.9059.python-list@python.org>
On 15/05/2011 12:04 PM, Neal Becker wrote:
> Far.Runner wrote:
>
>> Hi python experts:
>> There are two network interfaces on my laptop: one is 100M Ethernet
>> interface, the other is wifi interface, both are connected and has an ip
>> address.
>> The question is: How to get the ip address of the wifi interface in a python
>> script without parsing the output of a shell command like "ipconfig" or
>> "ifconfig"?
>>
>> OS: Windows or Linux
>>
>> F.R
>
> Here's some useful snippits for linux:

... and for Windows:

<code>
import wmi

for nic in wmi.WMI ().Win32_NetworkAdapterConfiguration (IPEnabled=1):
   print nic.Caption, nic.IPAddress

</code>

TJG

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web