Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change working directory of console in PyCharm

How do I change the default working directory when I open a new Python Console? I have multiple projects open in my PyCharm view and the Python Console seems to be defaulting to an arbitrary one. Of course I can work around by modifying sys.path but I want a definite solution. Using Windows.

like image 934
allenlin1992 Avatar asked Jun 14 '16 17:06

allenlin1992


People also ask

How do I change the working directory in PyCharm terminal?

Press Alt+Right and Alt+Left to switch between active tabs. Alternatively, you can press Alt+Down to see the list of all terminal tabs.

How do I change Python directory in PyCharm?

Change the Python interpreter in the project settingsPress Ctrl+Alt+S to open the IDE settings and select Project <project name> | Python Interpreter. Expand the list of the available interpreters and click the Show All link. Select the target interpreter.

How do I change the working directory in Python?

To change the current working directory in Python, use the chdir() method. The method accepts one argument, the path to the directory to which you want to change.


1 Answers

Settings → Build Execution Deployment → Console → Python Console

like image 144
Fallacy11 Avatar answered Oct 11 '22 23:10

Fallacy11