I want to do some scripting in python with pydev. The problem that I have is that I can't start the console in the project directory where the script is, the console starts in the pydev/aptana folder (somewhere in the aptana folder).
I can solve these adding the following code to my script:
import os
import inspect
filename = inspect.getframeinfo(inspect.currentframe()).filename
curpath = os.path.dirname(os.path.abspath(filename))
os.chdir(curpath)
Does somebody know how to change the directory of the console to the project position path automatically when started over the pydev Ctrl+Alt+Enter way ?
--EDIT--
Here is my own solution if someone like it more:
import sys; print('%s %s' % (sys.executable or sys.platform, sys.version)) import os;os.chdir([p for p in os.environ['PYTHONPATH'].split(os.pathsep) if ('Aptana Workspace' in p)][0]) pwd()