Search code examples
pythonpyinstallerexepy2exe

Python to exe automatically close


I wrote a .py code and converted it to a .exe using pyinstaller. It report the following problem:

  1. If I double click the .exe the program execute correctly (takes some input file, takes some input user digit, saves some output files etc..). When it ends the window automatically closes and I do not have time to look at the stamps.
  2. If I execute the .exe calling it from command prompt I do not register this problem. At the end of the execution the cmd windows is still open and I can navigate through it.

Should I set an option in Pyinstaller? Any advice?

Thanks.


Solution

  • Add a input() command to end of your program to get a key before exiting.