Этот файл получает пароли Wi-Fi с помощью команды терминала netsh wlan show Profiles
Раньше я использовал pyinstaller для создания нескольких .exe-файлов, и они работали нормально.
Кодекс:
import subprocess
import time
import sys
import re
command_output = subprocess.run(["netsh", "wlan", "show", "profiles"], capture_output = True).stdout.decode()
profile_names = (re.findall("All User Profile : (.*)\r", command_output))
wifi_list = []
if len(profile_names) != 0:
for name in profile_names:
wifi_profile = {}
profile_info = subprocess.run(["netsh", "wlan", "show", "profile", name], capture_output = True).stdout.decode()
if re.search("Security key : Absent", profile_info):
continue
else:
wifi_profile["ssid"] = name
profile_info_pass = subprocess.run(["netsh", "wlan", "show", "profile", name, "key=clear"], capture_output = True).stdout.decode()
password = re.search("Key Content : (.*)\r", profile_info_pass)
if password == None:
wifi_profile["password"] = None
else:
wifi_profile["password"] = password[1]
wifi_list.append(wifi_profile)
for x in range(len(wifi_list)):
print(wifi_list[x])
time.sleep(5)
print("No more WiFi Profiles Found")
time.sleep(3)
sys.exit()
Вот ошибка, которую я получаю при запуске .exe:
Traceback (most recent call last):
File "GetWiFiPassWord.py", line 6, in
File "subprocess.py", line 453, in run
File "subprocess.py", line 709, in __init__
File "subprocess.py", line 1006, in _get_handles
OSError: [WinError 6] The handle is invalid
Подробнее здесь: https://stackoverflow.com/questions/694 ... is-invalid
Ошибка pyinstaller: OSError: [WinError 6] Неверный дескриптор ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Необнаруженная ошибка chromedriver: OSError: [WinError 6] Неверный дескриптор
Anonymous » » в форуме Python - 0 Ответы
- 42 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Проблема с silero tts: OSError: [WinError 6] Неверный дескриптор. Питон Факел Нампи
Anonymous » » в форуме Python - 0 Ответы
- 57 Просмотры
-
Последнее сообщение Anonymous
-