Have a Tkinter battleship game application I wrote that I am trying to convert to an .app
file so I can run it easily on Mac OS X computers. After using cd
to navigate to the directory with both the main .py
file, and all the subfiles (three other Python files, a json file, and an icon file), I am executing the following command:
pyinstaller --onefile --windowed --icon favicon.icns --name Battleship battleship.py
This produces two files in the "dist" folder: Battleship
and Battleship.app
. The Battleship.app
has the icon I specified in the command above.
When I run the non .app
file (via double-clicking it), a terminal window opens and my Tkinter GUI opens and works (from the little testing I did) flawlessly. However, I would like only the GUI to open, without the terminal.
This is supposedly the purpose of also producing the .app
file. However, when I run the .app
file (via double-clicking it), it's icon merely bounces a few times in my application bar at the bottom of my screen, and then disappears. No actual window is opened.
How do I make it so when I double-click the .app
file, my application's GUI actually opens (without a terminal window)?
Using Python 3.5.1
.
--noconsole
option in your terminal command to avoid showing the terminal window in your compiled.app
file. – Avenge