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/
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
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", ""]
>
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
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
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
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
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')