Creation of.exe file with pyinstaller

Good morning, everyone,

How can I create a Python application so that when I start it, the CMD window doesn’t open and remains hidden?

For creating the .exe file, I’m using the following command in the command prompt:
pyinstaller --onefile’,
but I imagine there might be more to add. Can anyone lend me a hand?
I use windows 11.

thank you all

Save your script as a .pyw file and don’t use pyinstaller. By default, that’ll run the script in the background, without a visible terminal.

1 Like

Is the .exe file created following your instructions? I absolutely need it because I have to open the script executable from Movicon 11.6 SCADA software which only supports .exe applications.

Pass --windowed to pyinstaller.


“Problem” solved. thank you all