【发布时间】:2016-05-15 10:55:07
【问题描述】:
希望这应该很简单。如果我手动打开 PowerShell v3,Python 环境运行良好。我可以检查版本并运行外部脚本等。但是只要我通过 subprocess.Popen 从另一个应用程序的 python 脚本打开 powershell.exe,python 就不会运行; “‘Python’一词不被识别为 cmdlet、函数、脚本文件或可运行程序的名称......等”
我已经反复检查了我的环境路径,python 总体上在系统上运行良好。
有人知道这是什么原因造成的吗?
subprocess.Popen(["powershell.exe", '-ExecutionPolicy', 'RemoteSigned', "path to PS1_script_with python command"])
我的 PS1 文件如下所示:
cd C:\Users\David\Geeknote\geeknote-master\geeknote
python gnsync.py --path "C:\Users\David\Desktop\C4DtoEvernote", --mask "*.nfo", --notebook "Python Logs"
function Pause{Read-Host 'You have successfully synced your C4D Annotations to Evernote using gnsync.
Please press Enter to continue...' | Out-Null}
Pause{}
【问题讨论】:
标签: python-2.7 powershell-3.0 cinema-4d