Home > Mobile >  Run python.exe with Windows Terminal instead of Command Prompt
Run python.exe with Windows Terminal instead of Command Prompt

Time:11-17

Recently I am playing around with 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. All the output from Rich will not show in command prompt. Is there anyway to set python.exe run by other instead of command prompt?

My batch file looks like this:

"C:\Python39\python.exe" "C:\PATH\TO\PyScript.py"

Using Rich in Windows Terminal PowerShell

In Command Prompt

CodePudding user response:

Yes, there is a way to do this.

Just use this command:

powershell.exe "C:\Python39\python.exe C:\PATH\TO\PyScript.py"
  • Related