What are the best directory settings for Spyder? [poll]

Lorenzo_Pellegrino (770 points)
2 4 10
asked Dec 19, 2021 in Programming in Python by Lorenzo_Pellegrino (770 points)
reshown Dec 19, 2021 by Lorenzo_Pellegrino
Every time I have to work on homeworks or other exercises I struggle with the correct directories and I always have to change something manually, from the preferences to the console, so what are your favourite directory settings? I'm talking about those settings in Tools\Preferences\Current working directory\Startup, Console directory and Tools\Preferences\Run\Working directory settings. NOTE: I already possess a directory for all my programs and homeworks.
### no choices found for poll!
98 views

3 Answers

ruben.ciranni (4650 points)
7 13 31
answered Dec 19, 2021 by ruben.ciranni (4,650 points)
I suggest you creating a directory for the programming 1 course, where you put all the notes and all the HW directories. That way you keep everything tidy in your pc.
gabrimat (5630 points)
2 2 25
commented Dec 19, 2021 by gabrimat (5,630 points)
Totally agree. Create a clean and organized environment.
Lorenzo_Pellegrino (770 points)
2 4 10
commented Dec 19, 2021 by Lorenzo_Pellegrino (770 points)
I already have a directory for all my works plus a homework folder inside of it. I still have problems when it comes to inner directories: python always start in the wrong one
rokshana03 (7140 points)
1 2 26
answered Dec 19, 2021 by rokshana03 (7,140 points)
Uh well, I'm not sure how useful this may be but I have a whole directory for Programming where I store the homework files, but regardless of this,

In my settings at the "current working directory", in the Startup section I put "the current project director or user home directory" and in the Console directory I have "the current working directory".

On the "Run" section, in the "working directory settings", I have  "the directory of the file being executed".

This helps me out simply because when I run my file, you can see on your console "runfile(.......)" with the directory of the file you are executind and the wdir (working directory, I'm assuming) that has the whole directory where my homework resides so when I call a text file inside that, I can easily do it without putting the whooole directory of it
Luigi Pizza (6120 points)
11 20 65
answered Dec 19, 2021 by Luigi Pizza (6,120 points)
I like to keep the files separated: to have in a folder all the .py's (notes from class, exercises, also if i have to import something) and have a folder inside that directory named after the type of files it has inside. So if i want a txt file named whatever.txt, i'll just write 'txt\whatever.txt', or 'img\whatever.png'.

I found this really useful when handling different types of files.

Another really important thing is to put them in order. For example, I have all the notes I've taken since class 1 named in the form 'notes{number}-{prof}{date}'

So, for example, I have:

'notes50-Mancini17-12.py' or 'notes24-Spognardi03-11.py'

The number after notes increases with every new file, and it is there to put everything in chronological order.

As they are all together, I don't ever need to change directory