Hiding command-line dialog in py2exe Hiding command-line dialog in py2exe tkinter tkinter

Hiding command-line dialog in py2exe


Using setup(windows=['Main.py']) should remove the command line dialog and use Main.py as your console, instead.


Rename your entry point python script extension from .py to .pyw and regenerate your exe.

Example: python -m py2exe.build_exe -b 0 my_script.pyw

(tested with Python 3.4.3 on Windows 8.1 x64)

Example: my_script.pyw

import ctypesMessageBox = ctypes.windll.user32.MessageBoxWMessageBox(None, 'Hello', 'Hello Window Title', 0)

You should not see a command prompt for this GUI application.