Mailing List Archive

ORA Programming Python sample problem
I'm trying to run the demo code which came with the O'Reilly
Programming Python book. Specifically the "formgui.py" program
in the dbase directory.

When I try the "next" button I get this error message on stdout:

Exception in Tkinter callback
Traceback (innermost last):
File "/usr/local/lib/python1.5/lib-tk/Tkinter.py", line 752, in __call__
return apply(self.func, args)
File "formgui.py", line 51, in onNext
self.display()
File "formgui.py", line 61, in display
self.keytext(key) # change key in main box
AttributeError: no __call__ method defined


The "next" method given in the book and source sample, in its
entirety is:

def onNext(self):
if self.cursor >= len(self.index)-1:
self.infobox('Advance', "End of table")
else:
self.cursor = self.cursor + 1
self.display()


And at this point I'm lost:( I'm assuming that this was valid
code under 1.3, the version used in the book, and that it's
no longer valid. But I'd love to have someone tell me why:)

All hints, clues, comments welcome. Python 1.5.1, FreeBSD 2.2.7R.


Thanks,

David Miller
ORA Programming Python sample problem [ In reply to ]
David Miller <dmiller@gwi.net> wrote:
> I'm trying to run the demo code which came with the O'Reilly
> Programming Python book. Specifically the "formgui.py" program
> in the dbase directory.

...

> And at this point I'm lost:( I'm assuming that this was valid
> code under 1.3, the version used in the book, and that it's
> no longer valid. But I'd love to have someone tell me why:)

http://home.rmi.net/~lutz/errata.html
http://home.rmi.net/~lutz/progdiff.html

</F>
ORA Programming Python sample problem [ In reply to ]
On Tue, 4 May 1999, Fredrik Lundh wrote:

> > And at this point I'm lost:( I'm assuming that this was valid
> > code under 1.3, the version used in the book, and that it's
> > no longer valid. But I'd love to have someone tell me why:)
>
> http://home.rmi.net/~lutz/errata.html
> http://home.rmi.net/~lutz/progdiff.html

Aha! That definately helps!!

A thousand thanks Fredrik:)

--- David