Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win10系统中文版执行命令返回的是中文字符串,不能用正则匹配key #80

Open
Fcscanf opened this issue Sep 22, 2021 · 2 comments

Comments

@Fcscanf
Copy link

Fcscanf commented Sep 22, 2021

image
由于得到的字符串是中文的,所以需要换一种方式去解析

    elif sys.platform == "win32":
        password = run_command(f"netsh wlan show profile name=\"{ssid}\" key=clear")
        password_line = password.split("\r\n")[32]
        password = password_line[(password_line.find(":") if password_line.find(":") != -1 else password_line.find(":"))+ 1:].rstrip().lstrip()

另外由于PowerShell输出流编码为GBK,所以不同平台的解码也需要考虑
image

@CodeDiscovery1024
Copy link

能展示一下你怎么运行的吗,我打开setup之后,运行就出问题了。
Snipaste_2024-03-29_15-52-12
完全没明白怎么回事

@Fcscanf
Copy link
Author

Fcscanf commented Mar 30, 2024

主函数在如图的入口
image
setup是安装入口

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants