jeswang
jeswang

Reputation: 1027

How can I get a list of network adapters with Python, on all OS platforms?

How can I get a list of network adapters with Python, on all OS platforms? If doing this in a cross-platform way is not possible, how might I do this on OS X?

Upvotes: 0

Views: 923

Answers (1)

johnsyweb
johnsyweb

Reputation: 141888

netifaces seems to do the job on Mac OS X, Windows XP, Windows Vista, Linux and Solaris:

sudo easy_install netifaces

...and then...

>>> import netifaces
>>> netifaces.interfaces()

Upvotes: 4

Related Questions