Skip to content

Instantly share code, notes, and snippets.

@Yokii908
Forked from satishgunjal/wifissid.py
Created July 17, 2020 08:01
Show Gist options
  • Save Yokii908/45481e83f21795200b18417bd86ca04f to your computer and use it in GitHub Desktop.
Save Yokii908/45481e83f21795200b18417bd86ca04f to your computer and use it in GitHub Desktop.
Get connected wifi SSID using python on Raspberry pi
import subprocess
try:
output = subprocess.check_output(['sudo', 'iwgetid'])
print("Connected Wifi SSID: " + output.split('"')[1])
except Exception, e:
print e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment