Pythonw batch file still shows console

832 Views Asked by At

I have created a Python script for which I don't want to see the console pop-up every time it's being ran. I tried the pythonw.exe + .pyw approach, and while the script works just fine, the console still pops-up regardless.

.bat file content:

"C:\Users\mariu\anaconda3\pythonw.exe" "C:\Users\mariu\test.pyw" pause

And this is the inevitable console: enter image description here

Is there something am I missing?

1

There are 1 best solutions below

0
On

I had the same issue and moved to powershell script, since my tasks needed to start in parallel, and batch script seems not to behave like that, even with pythonw.exe

A .ps1 with the lines below should do the work

& "C:\Users\mariu\anaconda3\pythonw.exe" "C:\Users\mariu\test.pyw"
exit