I'm using Python(3.9) in Pycharm(11.0.10) venv, and I have a question regarding a Pycharm Error: FileNotFoundError: [Errno 2] No such file or directory:
.
It's some general questions regarding file path/directory/root thing that has been bugging me for some time.
I've partly solved the problem through some useful answers here; basically the same situation as this (link: 1).
Current attempts(partially solved):
First I tried to add source root folder via [Preferences → Project Structure] and failed. source roots were added but didn't make any difference. (photos attached)
I then edited a path via [Run → Edit configurations → Working directory ]. After this, I can access files within an external folder; which in this case is [textfile.txt] in [chapter4]folder. (photos attached)
Question:
Wondering if there’s a better way to operate?
To be more presice, is there no way to access one particular folder as a whole–in this case, the [Exercise Folder]– that contains several other folders/files (for instance, [chapter3][chapter4],[chapter5])..?
What's the purpose/correct-use of adding source roots in Pycharm..?
Photos: