From: Gelonida <gelonida@gmail.com>
Subject: [Py2exe-users] how to build same executabl with and without
       console output
To: py2exe-users@lists.sourceforge.net
Cc: python-list@python.org
Message-ID: <i2u1d5$6uj$1@dough.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1


>>however if being called with the option --debug it should display the
>>graphical window plus a debug console where I can print to.


>>Is there any trick in adding a console window to an application,
>>that was built as 'windows' application?
I don't think this is the right approach. This isn't py2exe's job.

Which GUI framework are you using?

In wxPython apps, it's very easy to redirect standard out to the GUI, so you can display messages
in a popup window, or any kind of widget you want. There is at least one example of this on the
wxPython wiki.

I would suspect other GUI frameworks have similar features, so you should inquire on the lists for those frameworks.

Then you just need to build one exe with py2exe.

Alternatively, you can just write your debug messages to a logfile, and run tail on the logfile.
There are win32 versions of tail in cygwin and or the Gnu win32 collection