Skip to content

Instantly share code, notes, and snippets.

@artizirk
Created August 20, 2016 17:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save artizirk/6aef38897fe9880f5fcf31f8e88a5c28 to your computer and use it in GitHub Desktop.
Save artizirk/6aef38897fe9880f5fcf31f8e88a5c28 to your computer and use it in GitHub Desktop.
get wifi networks from networkmanager
mport NetworkManager
networks = []
SSID = None
for dev in NetworkManager.NetworkManager.GetDevices():
if dev.Interface != 'wlan0':
continue
# Enumerate available networks
for ap in dev.SpecificDevice().GetAccessPoints():
# Skip non-AP SSIDs
if ap.Mode != 2:
continue
#print (dir(ap))
print (ap.Ssid, ap.WpaFlags, ap.Strength)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment