|
本帖最后由 云闲懒随风 于 2020-5-29 17:55 编辑
如题,在python脚本中调用了powershell命令,py脚本调试没问题,但是打包成exe后,powershell命令执行失败了就。打包使用 pyinstaller.exe -F -w隐藏了运行窗口。
部分代码:
args = [r"C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe", "-NonInteractive", "-c",
r"{}".format(r_data)]
res = subprocess.Popen(args, stdout=subprocess.PIPE)
stdout = res.stdout.read()
|
|