How to redirect in real time STDOUT from imported module to Tkinter Text Widget in python?

前端 未结 3 469
情书的邮戳
情书的邮戳 2020-12-19 10:17

I am trying to redirect stdout into a Tkinter Text widget in real time using Python 2.7.2 on Windows 7. In my code below, I intended to have a print statement appear in the

3条回答
  •  我在风中等你
    2020-12-19 10:56

    Instead of sleepBtn.update_idletasks(), this may be a neater solution:

    Put self.text_area.update_idletasks() before self.text_area.insert(END, str)

提交回复
热议问题