summaryrefslogtreecommitdiff
path: root/boot/listwifi.py
blob: 5ee14de7b160e4da9c269e34f79c68cf9d70d3f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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")