I want to use a .bat file to run a python script without a command prompt showing up. I've read that saving the script as .pyw should do the trick but somehow command prompt keeps showing up.
My .bat file looks like this:
@C:\Users\path\to\pythonw3.8.exe C:\Users\path\to\script.pyw
The python script does nothing but creates a simple shelve file:
import os, shelve
os.chdir(r'C:\Users\Sean\Desktop\Coding\Project-Updatable_Multi-Clipboard')
success = shelve.open('success')
When I double-click the .bat file the python script itself works as intended but for some reason, a command prompt shows up for a split second. I've tried exchanging "pythonw3.8.exe" in the .bat file with "pythonw3.exe" and "pythonw.exe" but I get the same behaviour as with plain "python.exe".
Do I have to modify the .bat file or the .pyw script in order to run the script without the command prompt popping up?