2024-05-19 00:42:16 发布
网友
import subprocess, re command = "netsh wlan show profile" networks = subprocess.check_output(command, shell=True) network_names_list = re.findall("(Profile\s*:\s)(.*)", "networks") print(network_names_list)
此代码将输出空列表,而不是wlan配置文件
你是说
networks = subprocess.check_output(command, shell=True) network_names_list = re.findall("(Profile\s*:\s)(.*)", networks) # ^^^^
您使用了字符串"networks"而不是变量networks(它可能保存您的输出)
"networks"
networks
你是说
您使用了字符串
"networks"
而不是变量networks
(它可能保存您的输出)相关问题 更多 >
编程相关推荐