Why do I have to use "global" so much when using Turtle?

Nobody nobody at nowhere.com
Sun Sep 22 09:48:58 EDT 2013


On Sat, 21 Sep 2013 21:39:07 -0700, John Ladasky wrote:

> However, neither Screen.ontimer() not Screen.onkeypress() appear to give
> me a way to pass arguments to functions of my own.  Why don't they?  Is
> this some limitation of Tk?  I have worked with other GUI's before, and I
> don't remember having to jump through this particular hoop.

The usual approach in Python is to pass a bound method of an object, and
keep all of the data on that object.




More information about the Python-list mailing list