Skip to content

Instantly share code, notes, and snippets.

@Davidnet
Created September 7, 2018 17:17
Show Gist options
  • Save Davidnet/2e58c70b8a7caf82996a2d16133d3f25 to your computer and use it in GitHub Desktop.
Save Davidnet/2e58c70b8a7caf82996a2d16133d3f25 to your computer and use it in GitHub Desktop.
def get_current_wifi_connection():
for line in iw('dev', 'wlan0', 'link', _iter=True):
if "SSID" in line:
return line.split(":")[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment