[Edu-sig] turtle module + win2K

Gregor Lingl glingl at aon.at
Tue Apr 6 13:14:30 EDT 2004



Jordan Johnson schrieb:

> Hi all,
>
> I've been experimenting with Python as a language (a possible 
> replacement for Scheme) for the 9th grade class I'm teaching, and was 
> pleased to find a turtle graphics module in it.  I'm now frustrated 
> with that, though, since its behavior (at least under Windows) is 
> pretty unpleasant--the window fails to redraw once the turtle stops 
> moving, leaving it looking like the thing is hanging.
>
This is a problem that arouse with Python 2.3 and IDLE 1.0.
It did not occur with Python 2.2 which used IDLE 0.8.
In IDLE 0.8 your program and IDLE itself ran in the same
process. Now that has changed.

There was a thread at EduSig about this topic. Have a look at:

http://mail.python.org/pipermail/edu-sig/2003-September/003149.html   and
http://mail.python.org/pipermail/edu-sig/2003-September/003153.html

and follow those threads.

There is a solution to this problem, which consist in making
IDLE run like it ran before, without subprocesses; namely through
using the -n option.

You have to change the link, which starts IDLE to

C:\Python23\pythonw.exe  "C:\Python23\Lib\idlelib\idle.pyw " -n

If you launch IDLE now, you'll get the message

IDLE 1.0.2      ==== No Subprocess ====
 >>>

And that's o.k. for you.

However leads to problems, when developing (large) projects.
We can observe them in the nutshell:

In you new IDLE type
 >>> a=1
 >>>

THEN create a program, testa.py, consisting of the line

print a

and run it. You'll get 1

Run from the commandline this program clearly results
in a NameError. And do does it in IDLE 1.0, which uses
it's separate namespces for it's programs.

*But* as long as you only want to do interactive
turtlegraphics to explore the turtle module, running
IDLE with the -n option will be ok (I suppose. At least
for me it is, and I useit this way in my classes.
In fact I have two Icons linked with IDLE on my tesktop,
the regular one and the -n - one. So I can use the
appropriate one, whenever I wish).

HTH,
Gregor

P.S. The same applies to interactively playing
around with Tkinter in general.

> Is this a Tk problem, or a poorly-written turtle module?  More 
> importantly, is there a convenient solution to this, aside from making 
> the IDLE shell/editor windows much smaller to accommodate the turtle 
> window?  I'm not averse to patching the module if need be, but I can't 
> afford the time to poke around in the code and library docs.
>
> Any info would be appreciated.
>
> Thanks,
> jmj
>
> : Jordan M Johnson - jorjohns @ cs . indiana . edu
> : If I were a bug, I would want to be a true Renaissance bug.
>
>
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>
>



More information about the Edu-sig mailing list