How to redirecting “stdout” to a Label widget?
问题 I am trying to redirect stdout to a Label widget. The goal is to "print" into the Label all the Python prints that are in my script. But when I click on BUTTON1 nothing happens... Here is my code: from Tkinter import * import sys import tkMessageBox class App: def __init__(self, master): self.frame = Frame(master, borderwidth=5, relief=RIDGE) self.frame.grid() class IORedirector(object): def __init__(self,TEXT_INFO): self.TEXT_INFO = TEXT_INFO class StdoutRedirector(IORedirector): def write