suffa
suffa

Reputation: 3806

Running a wxPython application in a Windows environment w/o the command prompt displaying

I developed an application with wxPython and used cx_freeze to covert it to a .exe. I installed the app on WinXP and it works fine. My only misgiving is that the GUI app is running with a command prompt behind it. How can I get rid of this command prompt? I imagine that it is there to display errors etc… There must be a way to redirect errors to a log file instead of showing this command prompt? Thanks in advance.

Upvotes: 0

Views: 400

Answers (2)

phkahler
phkahler

Reputation: 5767

You can rename your .py file to .pyw it will then run without displaying the console.

Upvotes: 0

Mike Driscoll
Mike Driscoll

Reputation: 33111

See How can I hide the console window when freezing wxPython applications with cxFreeze?

I also wrote this which has one solution:

http://www.blog.pythonlibrary.org/2010/08/12/a-cx_freeze-tutorial-build-a-binary-series/

The key part is near the end of the article:

from cx_Freeze import setup, Executable

exe = Executable(
    script="sampleApp.pyw",
    base="Win32GUI",
    )

setup(
    name = "wxSampleApp",
    version = "0.1",
    description = "An example wxPython script",
    executables = [exe]
    )

You need the bit that says this: base="Win32GUI"

Then it should work.

Upvotes: 2

Related Questions