Redirecting the command-line output to Tkinter