Nub needs help withTkinter

Agency image9n at hotmail.com
Sat Dec 6 18:23:54 EST 2003


I'm trying to program a utility that counts the beats per minute in a
song
by tapping the spacebar. I already have a program that does this, but
I wanted to make my own. The "enter" key resets the counter to zero
along with one of two displays. I'm importing Tkinter and this is what
I have so far. I get a syntax error at this spot ----->   
<KeyPress-space>
Any thoughts how to get the keypress to increase the counter better?
Is it possible to convert it to an int or something?
------------------------------------------------------------------
from Tkinter import *

root = Tk()
w = Label(root, text="The BPM Counter")
w.pack()

class display1:
    def beat():
        beat = 0
        if beat > 10000:
            beat += <KeyPress-space>
        
root.mainloop()
-------------------------------------------------------------------




More information about the Python-list mailing list