I have an .exe I'm packaging using pyinstaller and it works like a charm. However when the .exe is clicked, I have to wait nearly 10 seconds while staring at a blank console window for the actual application to start.

10 seconds of staring at this

From my research I've surmised that this is because of --onefile, and all the various files packaged in need to be unpacked before any code is run. I'm not concerned about the 10 second wait, but new users often need support because they think the program isn't working (reasonably so).

My ask is incredibly simple, but I can't figure out a way to do it: Is there anyway to get pyinstaller to run a tiny script BEFORE UNPACKING to just post a status blurb to the console, so users know that it's working?

2 Answers

Stevy On

As far as I know it is currently not possible to display custom messages before unpacking to let the user know the application is working. Source

There are a few workarounds to let the user know the program is working.

Display the console window

Displaying the console window after launching the application will output the status of the PyInstaller Bootloader while it is being opened.

To display the console, use the --console flag (or edit the .spec file to contain console = True) when bundling your application

Enable debug mode

To enable debug mode, use the --debug flag (or edit the .spec file to contain debug = True)


exe = EXE(pyz,
          console=True )
Community On

You could always wrap your program into 7zip installer. You can add a quick shell script to say "Loading..." before running your main program or you could just edit config.txt to do the same.

How do I make a self extract and running installer