How to write a program that can be run either as a console or a GUI application? (2009) | Hacker News Reader