debug scan
This commit is contained in:
1 parent
543628ea29
commit
ab86caf687
1 file changed
+4
-3
+4
-3
@@ -108,9 +108,9 @@ def scan_wifi():
|
|||||||
if columns[i] == 'Mbit/s':
|
if columns[i] == 'Mbit/s':
|
||||||
strength = columns[i+1]
|
strength = columns[i+1]
|
||||||
break
|
break
|
||||||
print("MAC地址:", mac_address)
|
# print("MAC地址:", mac_address)
|
||||||
print("Wi-Fi名称:", ssid)
|
# print("Wi-Fi名称:", ssid)
|
||||||
print("强度:", strength)
|
# print("强度:", strength)
|
||||||
|
|
||||||
wifi_list.append({'ssid': wifi_name, 'signal': strength, 'mac': mac_address})
|
wifi_list.append({'ssid': wifi_name, 'signal': strength, 'mac': mac_address})
|
||||||
if len(wifi_list) == 15:
|
if len(wifi_list) == 15:
|
||||||
@@ -118,6 +118,7 @@ def scan_wifi():
|
|||||||
# save wifi_list to file
|
# save wifi_list to file
|
||||||
with open('wifi_list.txt', 'w') as f:
|
with open('wifi_list.txt', 'w') as f:
|
||||||
for wifi in wifi_list:
|
for wifi in wifi_list:
|
||||||
|
print(f"{wifi['ssid']}, {wifi['signal']}, {wifi['mac']}")
|
||||||
f.write(f"{wifi['ssid']},{wifi['signal']}\n")
|
f.write(f"{wifi['ssid']},{wifi['signal']}\n")
|
||||||
|
|
||||||
return wifi_list
|
return wifi_list
|
||||||
|
|||||||
Reference in new issue
Block a user