Hi I am currently coding a random program at the moment, that effectively needs to see my MAC address.
This is what I have at the moment:
import subprocess
def get_mac():
mac_addr = subprocess.check_output(["ifconfig", "wlan0"])
Output from where i want the HWaddr extracted:
ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:1b:11:1e:97:29
inet addr:10.1.1.6 Bcast:10.1.1.255 Mask:255.255.255.0
inet6 addr: fe80::21b:11ff:fe1e:9729/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:91394 errors:0 dropped:0 overruns:0 frame:0
TX packets:58894 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:115550581 (115.5 MB) TX bytes:6097577 (6.0 MB)
So now I have the whereabouts of the MAC, but how would I extract it in that exact format? I looked around and couldn't fine anything other than URL extractions and such.
All I could find were re.search hich doesnt help me at all as I need to find a different MAC possible every time. Thanks
EDIT:
Sorry it's 5:30 and I am a bit tired. I realised I didnt even finish my question sorry. Not even the code :/ Edited now