From d31fabf8cff5dae02e3fc759a4203bd374dddc99 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 30 Mar 2014 16:03:44 -0400 Subject: Initial commit --- boot/listwifi.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 boot/listwifi.py (limited to 'boot/listwifi.py') diff --git a/boot/listwifi.py b/boot/listwifi.py new file mode 100755 index 0000000..5ee14de --- /dev/null +++ b/boot/listwifi.py @@ -0,0 +1,18 @@ +import os +import subprocess + +subprocess.call("iwlist wlan0 scan > temp.txt", shell = True) +output = open("temp.txt") + +lines = output.readlines() + +for index, line in enumerate(lines): + + if "Address" in line: + + address = line[29:-1] + name = lines[index + 1].split("\"")[1] + + print "%s is %s" % (address, name) + +os.system("rm temp.txt") -- cgit v1.3.1