elearn writes:
> How to get mac address of bluetooth with python in win7?
This may not be a Python-specific question. How would you get the MAC
adress of a Bluetooth device in Windows, in any programming language?
My advice is for you to do a web search
https://duckduckgo.com/?q=pyt
How to get mac address of bluetooth with python in win7?
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Jan 14, 2014 at 2:42 AM, William Ray Wing wrote:
> The one I've used is to spawn a subprocess and run the "ifconfig" command
> with no arguments (which doesn't require any special privileges).
Very small caveat: On some systems, running ifconfig doesn't require
privileges, but it's not i
one ethernet adapter. Most
> computers have two (wired and wireless) adapters.
>
> Getting a mac address is platform-specific, and the OP has not specified
> what OS he is using.
>
> On Windows I imagine you'd have to access the WMI subsystem in Windows.
>
> On Linux
On Sunday, January 12, 2014 12:34:35 AM UTC+8, Michael Torrie wrote:
> On 01/11/2014 07:35 AM, Andriy Kornatskyy wrote:
>
>
> On Linux you could access the /sys/devices/virtual/net/
>
> file in the sysfs filesystem. I'm sure there are other ways.
>
Thank you to everyone for the helpful answer
On Sun, Jan 12, 2014 at 8:55 AM, Roy Smith wrote:
> In article ,
> Chris Angelico wrote:
>
>> We had a connection set up a few years
>> ago where the ISP tech recorded the source MAC into the far end, and
>> only that MAC would work - so when I stuck in a different router, I
>> needed to switch
In article ,
Chris Angelico wrote:
> We had a connection set up a few years
> ago where the ISP tech recorded the source MAC into the far end, and
> only that MAC would work - so when I stuck in a different router, I
> needed to switch it to the old MAC before it could establish a
> connection.
On Sun, Jan 12, 2014 at 3:29 AM, Roy Smith wrote:
> If you don't believe that two machines can have the same MAC address,
> look up Hot Standby Router Protocol. And if you don't believe a machine
> can ignore the BIA and assign a new MAC address in software, look up
>
On 01/11/2014 07:35 AM, Andriy Kornatskyy wrote:
> Sam,
>
> How about this?
>
> from uuid import getnode as get_mac
> '%012x' % get_mac()
This seems to work if you have only one ethernet adapter. Most
computers have two (wired and wireless) adapters.
Getting a mac
In article ,
"James Harris" wrote:
> "Andriy Kornatskyy" wrote in message
> news:mailman.5329.1389450993.18130.python-l...@python.org...
> > Sam,
> >
> > How about this?
> >
> > from uuid import getnode as get_mac
> > '%012x&
"Andriy Kornatskyy" wrote in message
news:mailman.5329.1389450993.18130.python-l...@python.org...
> Sam,
>
> How about this?
>
> from uuid import getnode as get_mac
> '%012x' % get_mac()
AIUI that will return a mac address even if there isn't one. T
This is slightly longer than ChrisA's second solution:
>>> import uuid
>>> s = "%12x" % uuid.getnode()
>>> ":".join(x+y for x, y in zip(s[::2], s[1::2]))
'18:03:73:cb:2a:ee'
Skip
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, Jan 12, 2014 at 1:35 AM, Andriy Kornatskyy
wrote:
> from uuid import getnode as get_mac
> '%012x' % get_mac()
>
Code golf! Put colons in that, with as little code as possible.
# Way too verbose.
import uuid
l=list("%012x"%uuid.getnode())
l[10:10]=l[8:8]=l[6:6]=l[4:4]=l[2:2]=':'
mac = ''.
On Sun, Jan 12, 2014 at 1:26 AM, Sam wrote:
> I would like to use python to retrieve the mac address of the ethernet port.
> Can this be done? Thank you.
>
Did you try searching the web for 'python retrieve mac address' or similar?
There are several options offered
Sam,
How about this?
from uuid import getnode as get_mac
'%012x' % get_mac()
Thanks.
Andriy Kornatskyy
On Jan 11, 2014, at 4:26 PM, Sam wrote:
> I would like to use python to retrieve the mac address of the ethernet port.
> Can this be done? Thank you.
> --
> h
I would like to use python to retrieve the mac address of the ethernet port.
Can this be done? Thank you.
--
https://mail.python.org/mailman/listinfo/python-list
Lawrence D'Oliveiro wrote:
In message
, Booter
wrote:
I am new to python ans was wondering if there was a way to get the mac
address from the local NIC?
What if you have more than one?
you can try with netifaces :
http://pypi.python.org/pypi/netifaces/0.3
I use them on both Window
In message
, Booter
wrote:
> I am new to python ans was wondering if there was a way to get the mac
> address from the local NIC?
What if you have more than one?
--
http://mail.python.org/mailman/listinfo/python-list
All,
Thanks for all of the great solutions! Sorry I wasn't more specific
in my post and will keep that in mind for future posts. Just FYI I
was using a Windows machine and running Python 2.6.
Once again thanks for all of your help!
Gerad
--
http://mail.python.org/mailman/listinfo/python-list
On 04/02/2010 04:01 PM, Dan McLeran wrote:
> which is why my OP stated the solution was for windows:
>
> "for windows parse
> p.stdout.read():"
Gotcha. Definitely missed that!
--
http://mail.python.org/mailman/listinfo/python-list
"Booter" wrote in message
news:ec6d247c-a6b0-4f33-a36b-1d33eace6...@k19g2000yqn.googlegroups.com...
Hello all,
I am new to python ans was wondering if there was a way to get the mac
address from the local NIC?
Thanks for your help.
Gerad
This is what I use -
--
Booter wrote:
> Hello all,
>
> I am new to python ans was wondering if there was a way to get the mac
> address from the local NIC?
>
> Thanks for your help.
>
>>> import uuid
>>> uuid.getnode()
246090452741227L
>>>
This is supposed to return
On 04/02/2010 02:14 PM, Booter wrote:
> I am new to python ans was wondering if there was a way to get the mac
> address from the local NIC?
As Dan has indicated, you have to Popen an external command to get this
information. Every OS has different commands and syntaxes for this.
You'
On 04/02/2010 03:30 PM, Dan McLeran wrote:
> i'm running python 2.6 on win xp sp3 and i get:
Your code isn't portable to non-Windows OS's. On my Mac and on my Linux
workstations it simply doesn't work. Using '/usr/sbin/ifconfig' as the
executable name in Popen does work, however.
The OP didn't
On Apr 2, 2:52 pm, "danmcle...@yahoo.com"
wrote:
> On Apr 2, 2:14 pm, Booter wrote:
>
> > Hello all,
>
> > I am new to python ans was wondering if there was a way to get the mac
> > address from the local NIC?
>
> > Thanks for your help.
&
On 2-4-2010 22:55, danmcle...@yahoo.com wrote:
On Apr 2, 2:52 pm, "danmcle...@yahoo.com"
wrote:
On Apr 2, 2:14 pm, Booter wrote:
Hello all,
I am new to python ans was wondering if there was a way to get the mac
address from the local NIC?
Thanks for your help.
Gerad
f
On Apr 2, 2:52 pm, "danmcle...@yahoo.com"
wrote:
> On Apr 2, 2:14 pm, Booter wrote:
>
> > Hello all,
>
> > I am new to python ans was wondering if there was a way to get the mac
> > address from the local NIC?
>
> > Thanks for your help.
&
On Apr 2, 2:14 pm, Booter wrote:
> Hello all,
>
> I am new to python ans was wondering if there was a way to get the mac
> address from the local NIC?
>
> Thanks for your help.
>
> Gerad
for windows parse p.stdout.read():
import subprocess
p = subprocess.Popen('ip
Hello all,
I am new to python ans was wondering if there was a way to get the mac
address from the local NIC?
Thanks for your help.
Gerad
--
http://mail.python.org/mailman/listinfo/python-list
Matias Surdi <[EMAIL PROTECTED]> wrote:
> Anyone knows how having the IP address of a host on the lan could I get
> the mac address of that hosr?
> p/d: Parsing the output of arp -a is not an option.
What kind of system?
On linux and probably several other unix-like system
Michael Stro"der wrote:
> Matias Surdi wrote:
>
>> Anyone knows how having the IP address of a host on the lan could I get
>> the mac address of that hosr?
>>
>> p/d: Parsing the output of arp -a is not an option.
>>
>
>
Any reason w
Matias Surdi wrote:
> Anyone knows how having the IP address of a host on the lan could I get
> the mac address of that hosr?
>
> p/d: Parsing the output of arp -a is not an option.
But the ARP table is exactly what you need to access. This is probably
system-specific.
You could
Anyone knows how having the IP address of a host on the lan could I get
the mac address of that hosr?
p/d: Parsing the output of arp -a is not an option.
Thanks a lot!
--
http://mail.python.org/mailman/listinfo/python-list
| Is it possible to get the mac address of a device
| with python 2.4 using code which works in wxp and linux
| rather than requiring some code for windows and some
| other code for linux ?
I'm fairly sure the answer's no. It wouldn't be beyond
the wit of man to produce
Hello
Is it possible to get the mac address of a device
with python 2.4 using code which works in wxp and linux
rather than requiring some code for windows and some
other code for linux ?
Db
--
http://mail.python.org/mailman/listinfo/python-list
> I was looking on how to get MAC address universally (Windows and Linux) and
> found one package that is doing that and more...
> http://libdnet.sourceforge.net/
Thank you for the info too :)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Dejan Rodiger wrote:
> I was looking on how to get MAC address universally (Windows and Linux) and
> found one package that is doing that and more...
>
> http://libdnet.sourceforge.net/
>
Thanks for the info.
--
http://mail.python.org/mailman/listinfo/python-list
I was looking on how to get MAC address universally (Windows and Linux) and
found one package that is doing that and more...
http://libdnet.sourceforge.net/
--
Dejan Rodiger - PGP ID 0xAC8722DC
Delete wirus from e-mail address
--
http://mail.python.org/mailman/listinfo/python-list
Well, that kinda depends on what you want the MAC Address of. Personally (on
Unix systems) I
simply read from a popen('ifconfig') and use a regular expression to parse out
the mac address.
Works perfectly.
Just my 2¢,
Michael
--
http://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
> > you can read my temper from what I write ?
>
> If not, then you should be more careful what you write.
>
such as ?
--
http://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
> On 2005-12-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> >>>>Why should you want to associate a MAC address with a socket? Each
> >>>>interface has an IP address, and it's that you should be using.
> >>
On 2005-12-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>>>>>Why should you want to associate a MAC address with a socket? Each
>>>>>>interface has an IP address, and it's that you should be using.
>>>>>
>>>>>Say fo
On 2005-12-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>>>Why should you want to associate a MAC address with a socket? Each
>>>>interface has an IP address, and it's that you should be using.
>>>
>>> Say for example I want to fin
Steve Holden <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] wrote:
> > Steve Holden wrote:
> >
> >>Why should you want to associate a MAC address with a socket? Each
> >>interface has an IP address, and it's that you should be using.
> > Say for
Steve Holden wrote:
> I'm probably just not reading your responses carefully enough.
That is fine, misunderstanding happens all the time. And why I am
curious that there is no such thing in Python, it is because of this :
http://search.cpan.org/~lds/IO-Interface-0.98/Interface.pm
I am learning p
model,
> when I saw a "OS dependent" implementation of getting MAC. Nothing
> more. And your answer that there is not sufficient need for putting it
> in the standard libary(for the maintainance work needed), answered my
> puzzle.
>
>
>>I asked "Why should
getting MAC. Nothing
more. And your answer that there is not sufficient need for putting it
in the standard libary(for the maintainance work needed), answered my
puzzle.
>
> I asked "Why should you want to associate a MAC address with a socket?"
> and you replied "Say for e
[EMAIL PROTECTED] wrote:
> Steve Holden wrote:
>
>>[EMAIL PROTECTED] wrote:
>>
>>>Steve Holden wrote:
>>>
>>>
>>>>[EMAIL PROTECTED] wrote:
>>>>
>>>>
>>>>>Steve Holden wrote:
>>>>>
Steve Holden wrote:
> [EMAIL PROTECTED] wrote:
> > Steve Holden wrote:
> >
> >>[EMAIL PROTECTED] wrote:
> >>
> >>>Steve Holden wrote:
> >>>
> >>>
> >>>>Why should you want to associate a MAC address with
[EMAIL PROTECTED] wrote:
> Steve Holden wrote:
>
>>[EMAIL PROTECTED] wrote:
>>
>>>Steve Holden wrote:
>>>
>>>
>>>>Why should you want to associate a MAC address with a socket? Each
>>>>interface has an IP address, and it'
Steve Holden wrote:
> [EMAIL PROTECTED] wrote:
> > Steve Holden wrote:
> >
> >>Why should you want to associate a MAC address with a socket? Each
> >>interface has an IP address, and it's that you should be using.
> >
> > Say for example I wan
[EMAIL PROTECTED] wrote:
> Steve Holden wrote:
>
>>Why should you want to associate a MAC address with a socket? Each
>>interface has an IP address, and it's that you should be using.
>
> Say for example I want to find out the MAC if a particular interface in
> py
Steve Holden wrote:
> Why should you want to associate a MAC address with a socket? Each
> interface has an IP address, and it's that you should be using.
Say for example I want to find out the MAC if a particular interface in
python.
> It may well be possible to write Python code
ioctl to read this info
> out of the file handle of a socket but these modules don't exist on
> Windows(may be some other platform as well).
As you can see, this is a quick and dirty solution.
I am sure you can hack at it some more, bring up the associated ip
address, and compare it w
t;mac = line.split(':')[1].strip().replace('-',':')
>>break
>>else:
>>for line in os.popen("/sbin/ifconfig"):
>>if line.find('Ether') > -1:
>> mac = l
Frank Millman wrote:
> [EMAIL PROTECTED] wrote:
> > Sorry that I can't help you in any way but have a question myself. Is
> > there an OS independent way to get this thing(regardless of how to
> > format it) in Python ? I know this may not matter if all you want is
> > Windows but there is just a
[EMAIL PROTECTED] wrote:
> Sorry that I can't help you in any way but have a question myself. Is
> there an OS independent way to get this thing(regardless of how to
> format it) in Python ? I know this may not matter if all you want is
> Windows but there is just another thread talking about one
Daniel Crespo wrote:
> Hi, I tried:
>
> import ctypes
> import socket
> import struct
>
> def get_macaddress(host):
> """ Returns the MAC address of a network host, requires >= WIN2K.
> """
>
> # Check for api availabi
Hi, Scott,
Thanks for your answer
>> Hi, I tried: ...
>> # Convert binary data into a string.
>> macaddr = ''
>> for intval in struct.unpack('BB', buffer):
>> if intval > 15:
>> replacestr = '0x'
>> else:
>> replacestr = 'x'
>> macad
Daniel Crespo wrote:
> Hi, I tried: ...
> # Convert binary data into a string.
> macaddr = ''
> for intval in struct.unpack('BB', buffer):
> if intval > 15:
> replacestr = '0x'
> else:
> replacestr = 'x'
> macaddr = ''.join([macaddr,
Hi, I tried:
import ctypes
import socket
import struct
def get_macaddress(host):
""" Returns the MAC address of a network host, requires >= WIN2K.
"""
# Check for api availability
try:
SendARP = ctypes.windll.Iphlpapi.SendARP
except:
kyle.tk <[EMAIL PROTECTED]> wrote:
...
> new_mac = ''
> c = 0
> while len(new_mac) < 16:
> new_mac += mac[c:c+2] + ':'
> c=c+2
> return new_mac[:-1].upper()
...
> The part I think is bad is the while loop part. Could it be better?
What abou
I came up with this. Is there a better (more pythonic) way to do it?
import string
def mac_to_norm(mac):
def bad_char(char):
if char not in string.hexdigits:
return False
return True
mac = filter(bad_char,mac)
if len(m
[EMAIL PROTECTED] wrote:
> Hello,
> I am a newbie and i have problems filling an array with the mac address
> read from the command line.
>
> The mac address is FF:FF:FF:FF:FF:FF
>
> options, args = parser.parse_args()
> # options.d contains the address
> destAd
Hello,
I am a newbie and i have problems filling an array with the mac address
read from the command line.
The mac address is FF:FF:FF:FF:FF:FF
options, args = parser.parse_args()
# options.d contains the address
destAddress = options.d
data = array('L', '\0' * 24)
The arra
On 2005-05-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> How do i fill in a command line passed mac address for source mac
> address. The first six bytes of data[i] should contain destination mac
> and the next six bytes of data[i] should contain the source mac
> addres
Hello,
I am trying to fill a packet with source and destination mac address.
The first 6 bytes hold the destination mac address and the next six
bytes hold the source mac address. In the code i am filling in the
first six bytes to broadcast address for the destination.
# fill in the destination
Hello,
I am trying to fill an array with source and destination mac address.
The first 6 bytes hold the destination mac address and the next six
bytes hold the source mac address. Here's a snippet for filling in
broadcast address for the destination mac.
# Get destination address
data = arr
68 matches
Mail list logo