I have developed a quite complex Python script (about 2000 lines of code) that finds, filters, edits and opens hundreds of .csv and .xlsx files in several location. It creates differnet output files: .csv and .xlsx files with merged data, statistics, etc. Also creates automatically many figures with plots and log file. It all works fine. Scripts starts with a easygui button box asking the user a few inputs.
I wanted to make a self executable file that can be run in other machine without Python installed. And this works fine using PyInstaller. It takes about 3 to 5 minutes to complete the script. At the end of the script a easygui box message informs the user that the script finished successfully.
But after a few seconds the script starts again automatically. Only option to stop it is to cancel the easygui box (cross in corner) or kill the script in the background.
The code I use to create the stand alone executable script is:
PyInstaller.__main__.run(['My_script.py','--onefile','--windowed','--log-level=DEBUG', '--debug=all'])
How can I make my code such that when script is finished is not restarting itself again? Thanks for any hint!