[Edu-sig] What is the Best Way to use Python in the Windows Command Line

David MacQuigg macquigg at ece.arizona.edu
Fri Dec 19 03:18:50 CET 2008

At 09:59 AM 12/13/2008 -0500, csev wrote:

>I generally do not like IDLE - it uses a socket which can get messed  
>up, bugs in the student's code seem to mess up the IDE, when a program  
>needs to open a data file - it is hard to force IDLE into a known  

In Windows, drag the IDLE icon from the Start menu to your working directory.  That creates a shortcut.  Right click on the shortcut, and delete the "Start In" directory.  Repeat for every directory you wish to make a working directory.

Now when you click on one of those shortcuts, it starts IDLE with the current working directory prepended to the default sys.path.

As for the "socket" problem, I think you are referring to the "dueling event loops" problem.  If your program has an event loop involving Tkinter, your can't run it from IDLE, which also uses Tkinter.  What works nicely for me, is to do all my editing in the nice environment provided by IDLE, but run the program from a separate command window.  I also drag a command window shortcut to every directory where I need this strategy.

There is a good explanation of setup in John Zelle's Appendix B.

I know there are better IDE's available, but I keep coming back to IDLE.  It does what I need without a lot of clutter.

-- Dave

More information about the Edu-sig mailing list