"Adam" 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>
From http Thu Feb 17 08:41:51 2005
From: http (Paul Rubin)
Date: 16 Feb 2005 23:41:51 -0800
Subject: Pausing a program - poll/sleep/threads?
References: <
[email protected]>
Message-ID: <
[email protected]>
"Simon John" <simoninusa2001 at yahoo.co.uk> writes:
So, how would I make a Python program automatically call a function
after a preset period of time, without the Python process running in
the foreground (effectively single-tasking)?
See the signal module and use the alarm signal.