I am making a Python (3) GUI Program with tkinter, and I am using a redirect function to direct all my print statements to a GUI Scrolled text box.
This is the redirect function (in the same class as the tkinter window):
def redirector(self,inputStr):
self.txt.insert(tk.INSERT, inputStr)
self.txt.update()
self.txt.see(tk.END)
And then I add this line when I want to start redirecting the output:
sys.stdout.write = self.redirector
But when I rename the file to .pyw, nothing appears on the textbox. Please suggest a method to correctly direct the text to the GUI Window.
.py
right? - Jean-François Fabre