[英]Run python.exe with Windows Terminal instead of Command Prompt
Recently I am playing around with Rich.最近我在和 Rich 玩。 It's really helpful while debugging and tracking code running progress.
这在调试和跟踪代码运行进度时非常有用。 However, if I use task scheduler to auto-run python script, it will open command prompt to run the script instead of others like Window PowerShell.
但是,如果我使用任务调度程序自动运行 python 脚本,它将打开命令提示符来运行脚本,而不是像 Window PowerShell 这样的其他脚本。 All the output from Rich will not show in command prompt.
Rich 的所有输出都不会显示在命令提示符中。 Is there anyway to set python.exe run by other instead of command prompt?
无论如何设置由其他而不是命令提示符运行的python.exe?
My batch file looks like this:我的批处理文件如下所示:
"C:\\Python39\\python.exe" "C:\\PATH\\TO\\PyScript.py" "C:\\Python39\\python.exe" "C:\\PATH\\TO\\PyScript.py"
Yes, there is a way to do this.是的,有一种方法可以做到这一点。
Just use this command:只需使用此命令:
powershell.exe "C:\Python39\python.exe C:\PATH\TO\PyScript.py"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.