0

I would like to have all of my Python projects in subfolders under a main 'pydev' folder. When I launch Python, I'm in that 'pydev' top level folder.

\pydev\proj_1
\pydev\proj_2
etc

I'd like to issue a single command to switch to the project folder in question. The best I've found is

import os
os.chdir('proj_1')

Is there a better way to switch to a project's folder? Or is there a better way to manage multiple Python projects?

7
  • 2
    It's not a good approach, if you change your working directory at run time you may end up in error Commented Oct 26, 2013 at 19:21
  • 5
    This is an XY problem. What is the ultimate goal you intend to achieve by doing that? Commented Oct 26, 2013 at 19:21
  • 1
    as a side note, meta.stackexchange.com/questions/66377/what-is-the-xy-problem Commented Oct 26, 2013 at 19:23
  • 1
    And this is what modules are for. Commented Oct 26, 2013 at 19:26
  • 1
    you might be looking for workon command from virtualenvwrapper. Commented Oct 26, 2013 at 19:27

1 Answer 1

1

I would suggest using eclipse "working sets" since you are using PyDev. You can create a project and assign one or more projects to a working set. You can switch between working sets with one click.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.