[英]“start python” does not work in MS powershell for windows
Until yesterday I used to be perfectly able to run python scripts in python like so - 直到昨天,我以前完全能够像这样在python中运行python脚本-
start python [python_script_name] 启动python [python_script_name]
However by now, (in this span of time, I have installed GitHub, gotten stuck in booting Windows 7 and forced to use Windows Restore which removed GitHub and now Windows 7 boots) I can only use 但是,到目前为止,(在这段时间内,我已经安装了GitHub,陷入了启动Windows 7的困境,并被迫使用Windows Restore删除了GitHub,现在Windows 7启动了),我只能使用
start python.exe [python_script_name] 启动python.exe [python_script_name]
Can anyone tell me what's going on here? 谁能告诉我这是怎么回事?
[Python version - 2.7.5 Windows 7 Home] [Python版本-2.7.5 Windows 7主页]
start
is a command built into cmd.exe
, not PowerShell.exe. start
是cmd.exe
内置的命令,不是PowerShell.exe。 In PowerShell, start
is a default alias for the Start-Process
cmdlet, which operates differently than the start
command in cmd.exe. 在PowerShell中,
start
是Start-Process
cmdlet的默认别名,其运行方式与cmd.exe中的start
命令不同。
In PowerShell, you'll want to use a command like: 在PowerShell中,您需要使用类似以下的命令:
Start-Process -FilePath c:\path\to\python.exe -ArgumentList 'c:\path\to\script.ps1' -Wait -NoNewWindow;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.