I have played with Python code just a little and like it so far. I am using a Windows XP machine and have downloaded Python 2.5. As recommended in the "Starting Python" thread, I am saving my test files in the directory C:\Python25\Atest\.

When I bring up the IDLE editor, I would like it to come up with this directory. Is there a way to do this?

Dani AI

Generated

's suggestion to change how Windows starts IDLE is a simple and effective fix for the original question from . For completeness, here are a couple of alternative ways to guarantee IDLE opens with the folder you want and some practical tips to avoid future headaches.

A reliable, repeatable method is a small batch file that switches to your project folder and then launches IDLE. Example (save as something like start_idle.bat):

@echo off
cd /d C:\Python25\Atest
start "" "C:\Python25\pythonw.exe" "C:\Python25\Lib\idlelib\idle.pyw"

cd /d handles drive-letter changes; start "" provides a blank window title; pythonw.exe runs IDLE without a console window. Make sure the paths match your Python installation.

You can also open a command prompt, cd to your project folder and run IDLE directly with the full path to idle.pyw (or use your Python launcher if you prefer). This keeps the current working directory set to the project and is handy while testing scripts that read/write local files.

A few practical notes: keep your code outside the Python installation directory (use a Projects or Documents subfolder) to avoid permission and upgrade issues; double-clicking a .py typically runs it rather than opens it for editing unless you change file associations; and if a shortcut change seems ignored, verify which shortcut or launcher you actually use. For official details on IDLE behavior and options, see the IDLE docs: IDLE documentation.

Recommended Answers

All 2 Replies

On Windows right click on the IDLE icon and select Properties. Edit the "Start in:" information to the folder you want to have, then apply. That should do it!

Thank you! That works just fine!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.