Thread Tkinter problem

Hendrik van Rooyen mail at microcorp.co.za
Thu Dec 4 20:14:26 CET 2008


"Davy" <zhu.. at gmail.com> wrote:

>def gen_board_thread():
>    print 'enter here'
>    gen_flip = 1
>    while(True):

You don't need the brackets: while True: is good enough

>        time.sleep(0.3)
>        if (data_queue.full() == False):

write: if not data_queue.full():  , and lose the brackets here too.

>            if (gen_flip == 1):

 write:     if gen_flip:  (no brackets - not needed, ugly)

>                gen_flip = 0
>                data = board_1
>            else:
>                gen_flip = 1
>                data = board_2
>            data_queue.put(data)
>            print 'put', data_queue.qsize()

HTH - Hendrik




More information about the Python-list mailing list