Just when I thought I am 100% done with my app, turns out I was wrong. The app uses APScheduler to run several events at the same time and until now had been tested only in development mode, by bundling it in a single .exe file using Pyinstaller with the console visible for debugging purposes.
Very pleased I can finally remove the console window to distribute it to others, I was surprised to see that removing the console appears to mess up how APScheduler works. The times the tasks should be performed are wrong. Instead of the next time a task should run, it sets the current time, and no scheduled events are being executed. I have tried dragging it into the cmd to see if it shows any errors there, but it just stays blank. Everything else seems to be working fine, the GUI, the system tray code, the SQL tables, etc..
Briefly, the code I use is:
pyinstaller --add-data images.png;. --onefile --icon=trayicon.ico -w script.py
I also tried --windowed command. Funnily enough, --noconsole shows as an unrecognised argument.
I tried making it into a .pyw file but the same problem is observed.
Can anyone perhaps explain:
What actually happens on a deeper level when one removes the console/window from the executable? This might set me on the right path to figuring out the mess up with APScheduler.
Is there a way to just hide the console/window in the background, instead of removing it entirely?
PS: I am using Windows 10, Anaconda 3, Python 3.7.6, Spyder IDE