MCPcopy Index your code
hub / github.com/geekcomputers/Python / getwifi

Function getwifi

wifi hack by brutefore.py:52–75  ·  view source on GitHub ↗
(wifilist, wificount)

Source from the content-addressed store, hash-verified

50
51
52def getwifi(wifilist, wificount):
53 wifi = pywifi.PyWiFi() # crawled network interface cards
54 ifaces = wifi.interfaces()[0] # Get the card
55 ifaces.scan()
56 time.sleep(8)
57 bessis = ifaces.scan_results()
58 allwifilist = []
59 namelist = []
60 ssidlist = []
61 for data in bessis:
62 if data.ssid not in namelist: # remove duplicate names WIFI
63 namelist.append(data.ssid)
64 allwifilist.append((data.ssid, data.signal))
65 sorted(allwifilist, key=lambda st: st[1], reverse=True)
66 time.sleep(1)
67 n = 0
68 if len(allwifilist) != 0:
69 for item in allwifilist:
70 if (item[0] not in ssidlist) & (item[0] not in wifilist):
71 n = n + 1
72 if n <= wificount:
73 ssidlist.append(item[0])
74 print(allwifilist)
75 return ssidlist
76
77
78def getifaces():

Callers 1

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected