-
-
Save fernandoremor/d6a681a8a9dba7fb6c27f8a220b9017b 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