Now works with pythonw and py2exe'd exe output works as well.