Re: Threading and tkinter

2009-03-27 Thread Eric Brunel
(Sorry: replying to the wrong message here, but my newsreader somehow managed to miss the former post...) > On Mar 7, 9:40 am, Jani Hakala wrote: >> > After reading the docs and seeing a few examples i think this should >> > work ? >> > Am I forgetting something here or am I doing something stupi

Re: Threading and tkinter

2009-03-25 Thread gert
On Mar 7, 9:40 am, Jani Hakala wrote: > > After reading the docs and seeing a few examples i think this should > > work ? > > Am I forgetting something here or am I doing something stupid ? > > Anyway I see my yellow screen, that has to count for something :) > > I have been using the following sc

Re: Threading and tkinter

2009-03-07 Thread Jani Hakala
gert writes: > After reading the docs and seeing a few examples i think this should > work ? > Am I forgetting something here or am I doing something stupid ? > Anyway I see my yellow screen, that has to count for something :) > I have been using the following scheme: - Pass the root object to

Re: Threading and tkinter

2009-03-06 Thread gert
On Mar 6, 7:42 pm, a...@pythoncraft.com (Aahz) wrote: > [posted and e-mailed -- please reply to the group] > > In article > <492d5db9-3681-4ae8-827e-f2a4f66be...@v39g2000yqm.googlegroups.com>, > > gert   wrote: > > >After reading the docs and seeing a few examples i think this should > >work ? > >

Re: Threading and tkinter

2009-03-06 Thread Aahz
[posted and e-mailed -- please reply to the group] In article <492d5db9-3681-4ae8-827e-f2a4f66be...@v39g2000yqm.googlegroups.com>, gert wrote: > >After reading the docs and seeing a few examples i think this should >work ? This is a bit late, and I don't have time to review your code, but you s

Re: Threading and tkinter

2009-02-20 Thread Craig Allen
> The statement > >     x=x+1 > > (which, by the way, should stylistically be written > >     x = x + 1 > yes I was wondering what "x=x+1" meant until you translated it... oh, "x = x + 1" of course! I thought to myself. Oh wait no I'm sarcastic. -- http://mail.python.org/mailman/listinfo/python-

Re: Threading and tkinter

2009-02-20 Thread Hendrik van Rooyen
"gert" > Hope you do not mind ignoring part of answers, so I can figure out > more why things work the way they are. > This two examples work, what i do not understand is that in function > display i do not have to declare root, v or x ? > x is easy - it was declared outside, in module scope,

Re: Threading and tkinter

2009-02-19 Thread Scott David Daniels
gert wrote: Hope you do not mind ignoring part of answers, so I can figure out more why things work the way they are. This two examples work, what i do not understand is that in function display i do not have to declare root, v or x ? ... x=0 def weegbrug(): global x while True:

Re: Threading and tkinter

2009-02-19 Thread gert
Hope you do not mind ignoring part of answers, so I can figure out more why things work the way they are. This two examples work, what i do not understand is that in function display i do not have to declare root, v or x ? -- example 1 -- from tkinter import * from _thread import s

Re: Threading and tkinter

2009-02-19 Thread Hendrik van Rooyen
"gert" wrote: >On Feb 18, 8:25 am, "Hendrik van Rooyen" wrote: >> "gert" wrote: >> >> > After reading the docs and seeing a few examples i think this should >> > work ? >> > Am I forgetting something here or am I doing something stupid ? >> > Anyway I see my yellow screen, that has to count fo

Re: Threading and tkinter

2009-02-19 Thread gert
On Feb 19, 3:20 am, Steve Holden wrote: > gert wrote: > > Can you first explain why x stay's 0 please and how i should update x > > using threads ? > > > fromtkinterimport * > > from _thread import start_new_thread > > from time import sleep > > > x=0 > > def weegbrug(x): > >     while True: > >  

Re: Threading and tkinter

2009-02-18 Thread Steve Holden
gert wrote: > Can you first explain why x stay's 0 please and how i should update x > using threads ? > > from tkinter import * > from _thread import start_new_thread > from time import sleep > > x=0 > def weegbrug(x): > while True: > x=x+1 > sleep(0.5) > start_new_thread(weeg

Re: Threading and tkinter

2009-02-18 Thread gert
Can you first explain why x stay's 0 please and how i should update x using threads ? from tkinter import * from _thread import start_new_thread from time import sleep x=0 def weegbrug(x): while True: x=x+1 sleep(0.5) start_new_thread(weegbrug,(x,)) root = Tk() v = StringVar(

Re: Threading and tkinter

2009-02-18 Thread Scott David Daniels
gert wrote: After reading the docs and seeing a few examples i think this should work ? Am I forgetting something here or am I doing something stupid ? Anyway I see my yellow screen, that has to count for something :) Try this: # tdh_show.py from __future__ import with_statement import time im

Re: Threading and tkinter

2009-02-18 Thread gert
On Feb 18, 8:25 am, "Hendrik van Rooyen" wrote: > "gert" wrote: > > > After reading the docs and seeing a few examples i think this should > > work ? > > Am I forgetting something here or am I doing something stupid ? > > Anyway I see my yellow screen, that has to count for something :) > > > from

Re: Threading and tkinter

2009-02-17 Thread Hendrik van Rooyen
"gert" wrote: > After reading the docs and seeing a few examples i think this should > work ? > Am I forgetting something here or am I doing something stupid ? > Anyway I see my yellow screen, that has to count for something :) > > from tkinter import * > from threading import Thread > > class

Threading and tkinter

2009-02-17 Thread gert
After reading the docs and seeing a few examples i think this should work ? Am I forgetting something here or am I doing something stupid ? Anyway I see my yellow screen, that has to count for something :) from tkinter import * from threading import Thread class Weegbrug(Thread): def __init__