It is assumed that the execution environment of this script is OS X.
Command to scan wifi spots on Mac
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s
It seems that you should use. Reference URL http://yukisakamoto.hatenablog.com/entry/2013/09/24/014540
It seems surprisingly easy to run it in Python and get the result back It seems that it can be done in just a few lines
filename
#coding: utf-8
import commands
def main():
cmm = "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s"
try:
check = commands.getoutput(cmm)
except Exception, e:
print e
if __name__ == '__main__':
main()
Recommended Posts