Re: problems with tkinter updates

2012-01-29 Thread yves
In case somebody else is trying to do the same thing, this is what I ended up with to get the concept, that I can now integrate in other scripts: http://projects.zioup.org/scratchpad/python/tkrun.py -- Yves. http://www.SollerS.ca/

Re: problems with tkinter updates

2012-01-27 Thread yves
On 2012-01-24 02:52, Peter Otten wrote: Have update() (renamed to read_more() in my code) do the reading: import sys import tkinter import tkinter.scrolledtext root = tkinter.Tk() text_window = tkinter.Toplevel() text = tkinter.scrolledtext.ScrolledText(text_window) text.pack() infile = open

Re: problems with tkinter updates

2012-01-26 Thread Peter Otten
woooee wrote: [Peter Otten] >> line = next(infile, None) >> if line is not None: > if line is not None: probably does not work the way you expect. It does what I expect. > You might try > if line.strip(): > Take a look at this quick example > > test_lines = ["Number 1\n", "\n", ""] >

Re: problems with tkinter updates

2012-01-24 Thread woooee
if line is not None: probably does not work the way you expect. You might try if line.strip(): Take a look at this quick example test_lines = ["Number 1\n", "\n", ""] for ctr, line in enumerate(test_lines): print ctr, line if line is not None: print " not None" -- http://mai

Re: problems with tkinter updates

2012-01-24 Thread Peter Otten
y...@zioup.com wrote: > > I'm missing something about tkinter updates. How can I give tkinter a > chance to run? > > Here's some code: > > import time > import tkinter > import tkinter.scrolledtext > > tk = tkinter.Tk() > f = tkinter.Toplevel(tk) > st = tkinter.scrolledtext.ScrolledText(f) > s

Re: problems with tkinter updates

2012-01-23 Thread yves
On 2012-01-23 20:57, Dave Angel wrote: You have it backward. The question is not what you do inside your loop to give tk a chance, but rather what do you do to make tk give you a chance. tk doesn't "start" till you make the mainloop() method call, and once you call that method, it won't return

Re: problems with tkinter updates

2012-01-23 Thread Dave Angel
On 01/23/2012 08:09 PM, y...@zioup.com wrote: I'm missing something about tkinter updates. How can I give tkinter a chance to run? Here's some code: import time import tkinter import tkinter.scrolledtext tk = tkinter.Tk() f = tkinter.Toplevel(tk) st = tkinter.scrolledtext.ScrolledText(f) st

problems with tkinter updates

2012-01-23 Thread yves
I'm missing something about tkinter updates. How can I give tkinter a chance to run? Here's some code: import time import tkinter import tkinter.scrolledtext tk = tkinter.Tk() f = tkinter.Toplevel(tk) st = tkinter.scrolledtext.ScrolledText(f) st.pack() def update(): print('updating')