How to change default directory for IDLE in windows?

little白 picture little白 · Apr 11, 2013 · Viewed 10.4k times · Source

The installation directory is "d:\python2.7", and every time I open IDLE and click on menu File and Open item, the default directory is also "d:\python2.7". So I have to change the directory to where I want.

Is there any way I can change it? Using configuration file or changing environment variable?

I tried to add PYTHONPATH in environment variable, but it doesn't work. I also import os, and use os.chdir(), but it only changes the working directory, not what I want.

Thank you.

Answer

Aya picture Aya · Apr 11, 2013

If you're running IDLE from a Windows shortcut, you can just right-click on the shortcut, choose "Properties", and change the field "Start in" to any directory you like.