[CentralOH] Idle MacPython 2.6.4 / sys.Path

Mark Erbaugh mark at microenh.com
Wed Dec 30 15:16:08 CET 2009


I've installed MacPython 2.6.4 (from python.org) on my Mac with OS 10.6.2.

If I right click on a .py file, I get an option to open the file with Idle, which is what I want. An Idle python shell window opens as well as an Idle window with my .py file. However, the directory containing the folder I just opened is not added to sys.path(). On other platforms, that directory is added to sys.path.  I've not totally figured out how the Mac launches programs, such as Idle. Does anyone have any ideas on what I need to modify to add the current directory to sys.path()?  Note that I would like this directory to be different, depending on where I open a .py file.  I tend to do a lot of ad-hoc python scripting with little projects each in their own directory.

Thanks and Happy New Year,
Mark


More information about the CentralOH mailing list