I wrote the following class to create "monitoring" output in an additional window.
- Unfortunately, it does not scroll automatically to the very last line. What's wrong?
- Since I also have problems with Tkinter and ipython: what would the equivalent implementation look like with qt4?
Here is the code:
import Tkinter class Monitor(object): @classmethod def write(cls, s): try: cls.text.insert(Tkinter.END, str(s) + "\n") cls.text.update() except Tkinter.TclError, e: print str(s) mw = Tkinter.Tk() mw.title("Message Window by my Software") text = Tkinter.Text(mw, width = 80, height = 10) text.pack()
Using:
Monitor.write("Hello World!")
python qt qt4 ipython tkinter
Philipp der Rautenberg
source share