Threading and tkinter

gert gert.cuykens at gmail.com
Sat Mar 7 04:20:53 CET 2009


On Mar 6, 7:42 pm, a... at pythoncraft.com (Aahz) wrote:
> [posted and e-mailed -- please reply to the group]
>
> In article <492d5db9-3681-4ae8-827e-f2a4f66be... at v39g2000yqm.googlegroups.com>,
>
> gert  <gert.cuyk... at gmail.com> 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
> should see a good example here:
>
> http://www.pythoncraft.com/OSCON2001/index.html
> --
> Aahz (a... at pythoncraft.com)           <*>        http://www.pythoncraft.com/
>
> "All problems in computer science can be solved by another level of    
> indirection."  --Butler Lampson

Witch basically translate into stop being a smart ass and just do
this :)

from tkinter import *

def weegbrug():
    with open('com1','r') as f:
         for l in f:
             v.set(l[2:-1])
    root.after(500, weegbrug)

root = Tk()
v = StringVar()
v.set("00000")
txt = Label(root, textvariable=v, width=800, height=600, bg="yellow",
font=("Helvetica", 300))
txt.pack(expand=YES, fill=BOTH)
root.title("weegbrug")
root.overrideredirect(1)
root.geometry("%dx%d+0+0" % (root.winfo_screenwidth(),
root.winfo_screenheight()))
root.after(500, weegbrug)
root.mainloop()



More information about the Python-list mailing list