Font size
Adam
adam at eden.com
Thu Feb 17 19:00:19 EST 2005
More information about the Python-list mailing list
Thu Feb 17 19:00:19 EST 2005
- Previous message (by thread): Font size
- Next message (by thread): Font size
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Fredrik Lundh" <fredrik at pythonware.com> wrote in message news:mailman.2740.1108626296.22381.python-list at python.org... > "Adam" <adam at eden.com> wrote: > >> So we came up with the idea of using a random number generator to >> generate numbers from 0 to 36 and display them in large figures on my >> laptop. This is for the benefit of those people who are hard of hearing. >> They like to see what is happening. > > here's one way to do this: > > from Tkinter import * > from random import randint > from time import sleep > > def update(event=None): > for i in range(10): > label.config(text=str(randint(0,36))) > label.update() > sleep(0.05) > > # create a maximized window > root = Tk() > root.wm_state("zoomed") > root.title("my roulette wheel") > > # 80% of the screen height > height = int(root.winfo_screenheight() * 0.8) > > # create label (use negative font size for size in pixels) > label = Label(root, font="Arial " + str(-height), bg="gold") > label.pack(fill=BOTH, expand=1) > > # click anywhere in window to pick a new number > root.bind("<Button-1>", update) > > update() # display first number > > mainloop() > > (tweak as necessary) > > </F> > > I thank all of you. I will try each one of these suggestions. Adam.
- Previous message (by thread): Font size
- Next message (by thread): Font size
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list