Created
August 20, 2016 17:04
-
-
Save artizirk/6aef38897fe9880f5fcf31f8e88a5c28 to your computer and use it in GitHub Desktop.
get wifi networks from networkmanager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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