IDLE and turtle

dbrown2 at yahoo.com dbrown2 at yahoo.com
Tue Mar 23 11:03:59 EST 2004


Gregor Lingl <glingl at aon.at> wrote in message news:<405F2941.8070807 at aon.at>

...

> With Python 2.2 and IDLE 0.8 it was no problem to use turtle.py (and
> Tkinter in general) interactively, because tha application and IDLE
> itself ran in the same process (using the same mainloop()).

...

> *Fortunately* there is a way to use the new IDLE 1.0 exactly the
> same way as the old IDLE 0.8: to use it with the -n option.
> 
> Under Windows e. g. you have to change the link which calls IDLE as
> follows (or similar):
> 
> C:\Python23\pythonw.exe "C:\Python23\Lib\idlelib\idle.pyw " -n
> 
> This makes IDLE starting up without subprocesses, which is indicated
> by the message
> 
> IDLE 1.0.2      ==== No Subprocess ====

....

> I use to use two versions of IDLE (and I have two coresponding icons
> on my desktop). The one with the -n - option for interactive explorations,
> the other one, configured like it comes out of the box, for developing
> more complex programs.
> 
> HTH, Gregor


Thanks very much for your advice Gregor.  This work-around works
reasonably well for me.  I actually was getting quite used to the
process behavior in the new IDLE version and trying to forget
reload().  Now though I started using the "if __name__ == '__main__'
trick at the bottom of my module to load the code for testing and it
seems to do the job.  I'm not sure if there are any implications for
memory leaks with Tkinter this way (I'm repeatedly creating turtle
graphics canvases for the display and then just closing the Tkinter
window later to rerun the code) but for my limited needs it works.

Still, I hope someone can find a good long-term solution to these
kinds of window system problems.


David



More information about the Python-list mailing list