Skip to content

Instantly share code, notes, and snippets.

@jsbain
Created November 18, 2017 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsbain/66b3975828df7eabac6cdbce42fb1d41 to your computer and use it in GitHub Desktop.
Save jsbain/66b3975828df7eabac6cdbce42fb1d41 to your computer and use it in GitHub Desktop.
Untitled_168.py
from objc_util import *
load_framework('SystemConfiguration')
c.CNCopySupportedInterfaces.argtypes=[]
c.CNCopySupportedInterfaces.restype=c_void_p
c.CNCopyCurrentNetworkInfo.argtypes=[c_void_p]
c.CNCopyCurrentNetworkInfo.restype=c_void_p
ifs=c.CNCopySupportedInterfaces()
ifs=ObjCInstance(ifs)
for ifnam in ifs:
info=ObjCInstance(c.CNCopyCurrentNetworkInfo(ifnam))
if info['SSID']:
WIFIname=str(info['SSID'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment