Newbie question - TclError

Simon Brunning sbrunning at trisystems.co.uk
Mon May 15 08:24:32 EDT 2000


I've been looking at the 'Getting started with Python' article at
sunworld
(<http://www.sunworld.com/sunworldonline/swol-02-1998/swol-02-python
_p.html>), and I'm having a problem getting one of the examples
(calc.py) working. The code is as follows:

from Tkinter import *
from math import *

def evaluate(event):
        label['text'] = "Result:  " + str(eval(expression.get()))

frame = Frame(None)

entry = Entry(frame)
entry['textvariable'] = expression = StringVar()
entry.bind("", evaluate)

label = Label(frame)

button = Button(frame, text = "Submit", command = evaluate)

frame.pack()
entry.pack()
label.pack()
button.pack()
frame.mainloop()

I'm getting the error message 'TclError: no events specified in
binding'. I've had a hunt round the documentation - if there is an
answer in there, *I* can't find it.

Anyone going to take pity on a frustrated newbie?

--
Cheers,
Simon Brunning
TriSystems Ltd.
sbrunning at trisystems.co.uk
The opinions expressed are mine, and are not necessarily those of my
employer. All comments provided "as is" with no warranties of any
kind whatsoever.







More information about the Python-list mailing list