I developed a Python application that works both in GUI mode and in console mode. If any arguments are specified, it starts in console mode, otherwise it starts in GUI mode.
I managed to freeze this using cx_Freeze. I had some problems hiding the black console window that appeared with wxPython, so I changed my setup.py script as follows:
import sys from cx_Freeze import setup, Executable base = None if sys.platform == "win32": base = "Win32GUI" setup( name = "simple_PyQt4", version = "0.1", description = "Sample cx_Freeze PyQt4 script", executables = [Executable("PyQt4app.py", base = base)])
This works fine, but now when I try to open the console and run the executable, it does not output anything. I am not getting any errors or messages, so it seems that cx_Feeze redirects stdout to another place.
Is it possible to make it work with both modes? Nothing like this seems to be documented anywhere. :(
Thanks in advance.
Mridang
Mridang agarwalla
source share