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”
Advertisement
Answer
Yes, there is a way to do this.
Just use this command:
powershell.exe "C:Python39python.exe C:PATHTOPyScript.py"