-1

I have built a small desktop application which edits data(.ags format) and then saves to selected folder. Before i had an issue that, i could run it as python file, but it would crash when I make it .exe. I figured out the problem. The reason was that, particular line of code tries to prints to terminal, but .exe did not have it. I deleted sg.output() line from code, then used pyinstaller to make it .exe. Earlier i was using psgcompiler.

Now it works fine. However, when i open software the terminal opens as well (attached photo). Is there any chance to hide it, or add it to software itself? I tried multiline. I have tried to add, but it did not work.

[sg.Multiline(size=(55, 5), reroute_stdout=True)],

Thanksenter image description here

YIF99
  • 51
  • 1
  • 8
  • Please refrain from asking more than one question when posting on SO. This question needs more focus; Is this question about why the console-window shows when you launch your compiled `.exe` or about how you can select multiple files in `pysimplegui`? – Hampus Larsson Nov 17 '22 at 16:44
  • The most probable reason for the console-window is showing when you launch the `.exe` is due to how it was compiled. However, because you have not provided any details of how you did compile it, we cannot be sure that is the actual problem. If you can, please try to replicate the problem with a simpler program, and post both the code of the simpler program, and the compilation-command issued to create the `.exe` that has your problem. – Hampus Larsson Nov 17 '22 at 16:46
  • Thanks for the comment. I have compiled it just with the code " pyinstaller pythonFileName.py . Without the console, it is raising an error. So looking for ways of how to add output to the software itself instead of console window. – YIF99 Nov 17 '22 at 17:18

1 Answers1

1

By default pyinstaller compiles executables in console mode... which means that unless you tell it otherwise when the application is run outside of the command line, e.g. by double clicking the .exe a console window will always appear.

To avoid this simply use the windowed mode of pyinstaller with the -w flag when compiling.

pyinstaller -w myapp.py

Alexander
  • 16,091
  • 5
  • 13
  • 29