[Tutor] Maze - classes

Teresa Stanton tms43 at clearwire.net
Thu May 10 22:55:50 CEST 2007

I hope you are not tired of me posting about this, but I'm determined to understand what I'm doing wrong, and that means I'm pounding away, searching and not able to fix it or find what the problem is.

I've written the class to make the .gif move.  Now, this did work (to a point) when I was writing it as more of a script. I could get the .gif to move from one place to another, only to start at the same place again.  That is why the class became important, because I don't believe in globals. With my latest changes I get an error.

I've attached the latest code.  The problem is at the bottom where I'm trying to bind an event to <Button-1>.  This is the error message I get:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python25\lib\lib-tk\Tkinter.py", line 1403, in __call__
    return self.func(*args)
TypeError: unbound method direction() must be called with Images instance as first argument (got Event instance instead)

I've done some searching in the Greyson book (finally downloaded it) and can't seem to see what's wrong.  I also did a search on the 'TypeError:'  which I find funny because I thought Python wasn't strongly typed.  But I suppose that this is a simple error that one of you incredibly bright people will look at and I will respond with a 'Doh' (and a slap to the forehead). At least I hope so!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070510/43d0e82a/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mazeRev.pyw
Url: http://mail.python.org/pipermail/tutor/attachments/20070510/43d0e82a/attachment.pot 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DustY.gif
Type: image/gif
Size: 6733 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20070510/43d0e82a/attachment.gif 

More information about the Tutor mailing list