Is it possible to create a windows app that will start a GUI when exectued without arguments, but will behave like a console app when run from the command line with arguments?

In the past I created both a console app and windows app.  They both performed the same calculation.  Generating two applications was never an issue before because my applications were dependent on many other files.  Now that I have upgraded to py2exe v0.6.3 I'm using the bundle option.  The directory full of dependencies has been reduced to my two executables (and MSVCR71.dll if I use Python24).  Since both the GUI and console version perform exactly the same calculation, it would be nice if they could be combined.  I have added the console features to the GUI script.  However, when I package it as a windows app the console features are broken.

My understanding (from reading the "black hole" posts and boot_common.py) is that the breaking of stdout is the intended behavior for a windows app.  Is there a way to conditionally undo the "blackholing" of stdout in my script?  I'd rather not hack boot_common.py because most of the time I will probably want the default behavior.

Thanks,
Teddy