Issue: IDLE always starts using a specific windows directory: 'C:\Python36'. That is my installation directory. I do not want to keep my project files in that directory. I want files for a specific project in a separate project directory.
After hours of searching, I did not find an answer to my specific question. I did find a helpful clue in How to start IDLE (Python editor) without using the shortcut on Windows Vista?
The solution that meets my needs is to create a file: idlehere.py
import idlelib.pyshell
idlelib.pyshell.main()
I then place that file in my project directory and execute the file with
python idlehere.py
This starts IDLE in my project directory.
Even though this works for me, I am posting this question in case it helps others; or in case there is a better way to accomplish my objective.
UPDATE: From the comment and with further experience I have learned additional ways to start IDLE in a specific Windows directory. For each case open a command prompt in the desired directory.
- At the command prompt, enter python. That starts python in interactive mode.
- To start idle enter: import idlelib.idle
- At the command prompt, enter python -m idlelib
- At the command prompt, enter python -m idlelib.idle