Skip to content
Advertisement

Run python.exe with Windows Terminal instead of Command Prompt

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:Python39python.exe” “C:PATHTOPyScript.py”

Using Rich in Windows Terminal PowerShell

In Command Prompt

Advertisement

Answer

Yes, there is a way to do this.

Just use this command:

powershell.exe "C:Python39python.exe C:PATHTOPyScript.py"
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement