I\'ve developed a Python application that runs both in the GUI mode and the console mode. If any arguments are specified, it runs in a console mode else it runs in the GUI m
Raymond Chen has written about this: http://blogs.msdn.com/b/oldnewthing/archive/2009/01/01/9259142.aspx. In short, it's not possible directly under Windows but there are some workarounds.
I'd suggest shipping two executables - cli and gui one.