WIFI spot scan in Python

Preface

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

WIFI spot scan in Python
Python in optimization
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
Meta-analysis in Python
Unittest in python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
Plink in Python
Constant in python
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
N-gram in python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Constant in python
nCr in Python.
format in python
Scons in Python3
Puyo Puyo in python
python in virtualenv
PPAP in Python
Quad-tree in Python
Reflection in Python
Chemistry in Python
Hashable in python
DirectLiNGAM in Python
LiNGAM in Python
Flatten in python
flatten in python
Daily AtCoder # 36 in Python
Clustering text in Python
Implement Enigma in python
Daily AtCoder # 32 in Python
Daily AtCoder # 6 in Python
Daily AtCoder # 18 in Python
Edit fonts in Python
Singleton pattern in Python
File operations in Python
Read DXF in python
Daily AtCoder # 53 in Python
Key input in Python
Use config.ini in Python
Solve ABC168D in Python
Daily AtCoder # 7 in Python
LU decomposition in Python
One liner in Python
Simple gRPC in Python
Daily AtCoder # 24 in Python