tags:

views:

37

answers:

2

What is the default working directory for my project? I have several projects under my workspace, and a couple of run configurations. I use os.getcwd() and the directory goes to other project's folder, after deleting all run configurations, the directory goes to eclipse's install folder. How to make the default working directory goes to my project folder or the \src folder?

EDIT:

In my PYTHONPATH that will be used in the run:

C:\Program Files\eclipse\dropins\plugins\org.python.pydev_1.5.4.2010011921\PySrc\pydev_sitecustomize;
C:\(MyProjectDirecotry)\\src;
C:\Python26;
C:\Python26\DLLs;
C:\Python26\lib;
C:\Python26\lib\lib-tk;
C:\Python26\lib\plat-win;
C:\Python26\lib\site-packages

maybe there's C:\Program Files\eclipse\dropins\plugins\org.python.pydev_1.5.4.2010011921\PySrc\pydev_sitecustomize; in the first line causing the issue. Why is this happened? How to revert it back to default? Thanks.

A: 

My CWD is always the directory where the .py file with the main entry point is located.

jskaggz
I believe that's the default, but how come mine is not.
Stan
Check the contents of your .pydevproject file in your project directory (it's hidden from eclipse.) Is its value for "path" what you think it should be - or is it the value of the directory you don't want? :-)
jskaggz
Looks good.<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"><path>/(MyProjectDirecotry)/src</path></pydev_pathproperty>
Stan
+1  A: 

Open Run Dialog...-> Select your run configuration->Arguments Tab->Working directory:

mine is set to ${workspace_loc}:test/src/ for a project name test i created in my workspace

iondiode