Search code examples
pythonpython-3.xexecx-freeze

How to make cx_Freeze python exe windowless


Recently, I have created a python program which I like very much. Using cx_Freeze, I turned it into an exe. My issue right now, it that the program seems to be working perfectly... Except it runs with a blank window (looks like a cmd line window).

I had hoped that changing the python file to a .pyw and re-compiling would do the trick. Unfortunately, it did nothing.

Does anyone know of a way to make this (annoying) window go away?


Solution

  • if sys.platform == "win32":
        base = "Win32GUI"
    

    Should do the trick, see http://cx-freeze.readthedocs.org/en/latest/distutils.html