Cx_Freeze help: is there any way NOT to open the console?

I am trying to convert a python game (made with pygame) to an exe file for windows and I used cx_Freeze. No problem.
The fact is that when you start myGame.exe, the usual Pygame window opens and the console window (which I donโ€™t want).

Is there any way to remove the console window? I read most of the documentation but didnโ€™t see anything (except the base, but I donโ€™t understand what it is).

By the way, here is my settings file:

import cx_Freeze exe = [cx_Freeze.Executable("myGame.py")] cx_Freeze.setup( name = "GameName", version = "1.0", options = {"build_exe": {"packages": ["pygame", "random", "ConfigParser", "sys"], "include_files": [ "images", "settings.ini", "arialbd.ttf"]}}, executables = exe ) 

Here is a snapshot of what happens when I run exe: Screen shot

+5
source share
1 answer

So what happened was that there was no parameter in the setup.py file.
You need to add base = "Win32GUI" to declare that you do not need a console window when starting the application.
Here is the code:

 import cx_Freeze exe = [cx_Freeze.Executable("myGame.py", base = "Win32GUI")] # <-- HERE cx_Freeze.setup( name = "GameName", version = "1.0", options = {"build_exe": {"packages": ["pygame", "random", "ConfigParser", "sys"], "include_files": ["images", "settings.ini", "arialbd.ttf"]}}, executables = exe ) 
+6
source

All Articles