LoginSignup
6
7

More than 5 years have passed since last update.

PythonでWIFIスポットスキャン

Posted at

前書き

このスプリクトの実行環境はOSXであることを前提にしています。

Macでwifiスポットをスキャンする場合は、コマンド

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s

を使えばいいようです。
参考URL
http://yukisakamoto.hatenablog.com/entry/2013/09/24/014540

それをPythonで実行し結果をreturnさせるのは案外簡単なようで
わずか数行でできてしまうそう

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()

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7