Dang Manh Truong
Dang Manh Truong

Reputation: 656

Spyder 3 (Anaconda) on Ubuntu- How to change working directory to that of terminal

I'm using Spyder 3 bundled with Anaconda Python on Ubuntu. Usually with other Python IDEs (like IDLE,...) when i want to work inside a specific folder, I just go to that folder then open a terminal, type "idle" and the IDE pops up, then I can work inside that folder. But with Spyder when i open a terminal, type "spyder" , the Spyder IDE still works at the default directory! How can I change this? Please help me, thank you very much

Upvotes: 0

Views: 2025

Answers (2)

Carlos Cordoba
Carlos Cordoba

Reputation: 34136

(Spyder maintainer here) The options to configure the current working directory are present in

Tools > Preferences > Current working directory.

We don't have a graphical way to sync that with the directory of the terminal from which Spyder was started, but there's a command line option to do it, as @Bartłomiej mentioned.

Upvotes: 1

Bartłomiej
Bartłomiej

Reputation: 1078

You can change working directory after opening Spyder by typing inside IPython console cd path/to/working/dir.

EDIT:

I have found how you can set directory from the command line (from spyder3 --help). It is -w flag:

 spyder3 -w path/to/dir

or

cd path/to/dir
spyder3 -w `pwd`

Upvotes: 1

Related Questions