From 851a544ead5c8a8b4676796a0587968901c8b856 Mon Sep 17 00:00:00 2001 From: JulianHoch Date: Thu, 13 Jan 2011 09:03:26 +0000 Subject: [PATCH] redirect stdout for windows --- ektaprogui.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ektaprogui.py b/ektaprogui.py index 01af4d0..dea3675 100755 --- a/ektaprogui.py +++ b/ektaprogui.py @@ -38,6 +38,7 @@ import time import tkMessageBox import tkSimpleDialog +import os @@ -1279,12 +1280,22 @@ def apply(self): tkMessageBox.showinfo("Command Result", \ "Interpreted Command: " + message) + +class NullDevice(): + def write(self, s): + pass -if __name__ == '__main__': +if __name__ == '__main__': + logger = logging.getLogger() - logger.setLevel(logging.DEBUG) + logger.setLevel(logging.CRITICAL) + + if os.name == "nt": + import sys + sys.stderr = NullDevice() + sys.stdout = NullDevice() mainWindow = EktaproGUI() mainWindow.mainloop()