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

2013-09-23 Thread John Ladasky
No, Rusi, I have never seen Pynguin before -- and it looks very cool! -- https://mail.python.org/mailman/listinfo/python-list

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

2013-09-22 Thread Peter Otten
John Ladasky wrote: Hi, folks, Some of you may remember that I am teaching some high school students how to program. Because they all love graphics, I have been investigating the turtle module, which I gather is built on top of Tk. I can see that real-time applications are possible. I'm

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

2013-09-22 Thread Steven D'Aprano
On Sat, 21 Sep 2013 21:39:07 -0700, John Ladasky wrote: Hi, folks, Some of you may remember that I am teaching some high school students how to program. Because they all love graphics, I have been investigating the turtle module, which I gather is built on top of Tk. I can see that

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

2013-09-22 Thread Ned Batchelder
On 9/22/13 12:39 AM, John Ladasky wrote: For a while, I had a quit function that I bound to the q key: sc.onkeypress(quit, q) The quit function simply printed a message, and then called sc.bye(). As with move_balls, quit wouldn't work unless I had a global sc declaration in it. (My

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

2013-09-22 Thread Nobody
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

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

2013-09-22 Thread John Ladasky
All right, never mind! I hacked around this morning, making some changes to parts of my program that I thought were unrelated to my namespace issues. I was paring it down to a minimal example, to post here as Ned requested. As an experiment, I also commented out the global declaration line

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

2013-09-22 Thread rusi
On Monday, September 23, 2013 12:27:50 AM UTC+5:30, John Ladasky wrote: All right, never mind! I hacked around this morning, making some changes to parts of my program that I thought were unrelated to my namespace issues. I was paring it down to a minimal example, to post here as Ned

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

2013-09-21 Thread John Ladasky
Hi, folks, Some of you may remember that I am teaching some high school students how to program. Because they all love graphics, I have been investigating the turtle module, which I gather is built on top of Tk. I can see that real-time applications are possible. I'm writing a classic