By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

How to get my MAC address with python ?

P: n/a
Hi,

I want to know the MAC address of my local network card with a python
script.
I tested the socket module which gives only the IP address.
Is someone have an idea ?

Thanks.

O.R.

Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In article <bv**********@news.univ-rennes1.fr>,
olivier Ravard <ra****@univ-rennes1.fr> wrote:
Hi,

I want to know the MAC address of my local network card with a python
script.
I tested the socket module which gives only the IP address.
Is someone have an idea ?

Jul 18 '05 #2

P: n/a
olivier Ravard wrote:
Hi,

I want to know the MAC address of my local network card with a python
script.
I tested the socket module which gives only the IP address.
Is someone have an idea ?


Here's a url where Mark Hammond explains how to do it on Windows:

http://groups.google.com/groups?oi=d...m=an_603363272

On Linux you can parse the output of the ifconfig command as described in
following url:

http://mail.python.org/pipermail/pyt...st/008816.html

Jul 18 '05 #3

P: n/a
Cameron Laird wrote:
In article <bv**********@news.univ-rennes1.fr>,
olivier Ravard <ra****@univ-rennes1.fr> wrote:
Hi,

I want to know the MAC address of my local network card with a python
script.
I tested the socket module which gives only the IP address.
Is someone have an idea ?


.
.
.
What operating system interests you?


Linux and windows. If there is a portable procedure it would be fine!

Jul 18 '05 #4

P: n/a
Rick Holbert wrote:
olivier Ravard wrote:

Hi,

I want to know the MAC address of my local network card with a python
script.
I tested the socket module which gives only the IP address.
Is someone have an idea ?

Here's a url where Mark Hammond explains how to do it on Windows:

http://groups.google.com/groups?oi=d...m=an_603363272

On Linux you can parse the output of the ifconfig command as described in
following url:

http://mail.python.org/pipermail/pyt...st/008816.html


It is also arbitrarily trivial to parse the output of ipconfig /all in
Windows 2k/xp/2k3. Windows 98/ME would be different.

- Josiah

Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.