[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IDLE Default Working Directory

> On Nov 12, 2018, at 10:07 AM, Brian Oney <brian.j.oney at googlemail.com> wrote:
> On Mon, 2018-11-12 at 09:35 -0600, Bev in TX wrote:
>> I am not the OP and I?m on macOS ? no shortcuts.  How would one do the same thing on other platforms?
>> Bev in TX
> Hello there,
> I am not an IDLE user. You may try a startup script from python, as per the following.
> oney at oney <mailto:oney at oney>:~$ cat pyhelp/change_to_current_dir.py 
> #!/usr/bin/env python3
> import os
> import sys
> os.chdir(os.path.dirname(os.path.abspath(__file__)))
Thanks so much for taking the time and effort to provide that script.  I experimented with it, but it does not work as desired in Idle.  I tried:
* Changed to project directory and then opened Idle
     Idle -> File-> Open still opens ~/Documents ? not the project folder.
* Placed the change folder script in ~/Documents, opened it in Idle and ran it 
     Idle did not change to the project folder ? it stayed in whichever folder the change folder script resided.

Unless someone can come up with a better option for macOS, the best that I can think of is to add the project folder to the side bar so that it is easier to access it in Idle -> File -> Open.
Bev in TX