IDLE Default Working Directory

Irv Kalb Irv at furrypants.com
Wed Nov 14 19:20:07 EST 2018


> On Nov 13, 2018, at 6:04 PM, Christman, Roger Graydon <dvl at psu.edu> wrote:
> 
> On 13 Nov 2018, at 09:51, Bev in TX <countryone77 at gmail.com> wrote:
> ________________________________
>> On Nov 12, 2018, at 5:50 PM, Terry Reedy <tjreedy at udel.edu> wrote:
>> 
>> For me, open (command-O) opens 'Documents'.  I presume it should be easy enough to move into a 'py' subfolder.
> 
> The whole point is for Idle -> File -> Open (or command-O) to automatically open to a specific folder.
> 
> Bev in TX
> 
> 
> Thank you, Bev in TX for clarifying my question.  That is indeed what I seek.   My course has proved cumbersome every time a student created a new program in class, since they would have to change folders.    And when
> 
> I got to working with data files, I ended up with a little punt to avoid having to specify a complete path name to get to a workable directory.
> 
> 
> My students are not programmers.  I have English majors, Education majors, and students in their first year at a University.  I won't say they are completely computer-illiterate, they can use a browser well enough.   But I expect none of them to have ever seen the command line, so I really don't want to go that route.
> 
> 
>  <snip>
> 
> And the real challenge is to come up with the simplest
> 
> solution that I can explain or show to first-time programming students in under a minute, which therefore does not involve the command-line interface.
> 

I teach a similar set of students, using IDLE.  (Most have never seen or want to see a command line.) I teach in both Mac and Windows classrooms.  I rarely, if ever use Command/Control O to open a Python file. 

On Windows systems, I ask students to find the file that they want to open in the Windows Explorer, right click, and select Edit with IDLE (usually the second item in the context menu).  

On a Mac, the computers are often set up to open Xcode as the default.  I show the whole class how to select any Python source file sing the Finder, do a Get Info (Command I), change the default application to IDLE, and do a Change All.  Once that is done, students just double click on any file with a .py extension and opens it in IDLE.

When working with data files, I tell students to put their project (their main program and any other related files) in a folder.  Then, in their calls to "open", I tell them to just give the name of the data file e.g., 'MyData.txt', or a path relative from the current folder, e.g., 'MyData/DataFile.txt'.  That makes things simple in a teaching environment and works on both Macs and Windows.

Maybe not what you were looking for, but I hope it helps,

Irv





More information about the Python-list mailing list