This one tells me the mac address (bssid) of the access point I am connected to with wireless zero configuration using wmi.

import win32com.client

def mhex(mac):
    return "".join('%02x' % x for x in mac)

wmi2 = win32com.client.GetObject("winmgmts:!root/wmi")
adapters = wmi2.execquery("select * from MSNdis_80211_BaseServiceSetIdentifier")
for ad in adapters:
    print ad.InstanceName
    print ad.Active and 'Active' or 'Inactive'
    print mhex(ad.Ndis80211MacAddress)
Advertisements