My project structure looks like this:
Repo/
|-- data/
| |-- a.csv
| |-- b.csv
|
|-- src/
| |-- project/
| |-- c.py
|
|-- .gitignore
|-- README.md
I'm new to structuring my projects like this, as they are mostly private repos, but I thought that it would be nice to start structuring them like "real" public projects to get used to the techniques used. I searched up some recommended python project structures and found this one. I know there are some discussions about whether to use src/
or not, but I just decided to go with this one. (Any suggestions appreciated!)
Now I want to list the files in the data/
directory from my c.py
module. To do so I used os.scandir('data/')
which worked fine for me. But for a friend of mine, who has access to the repo, it didn't. He had to use os.scandir('../../data/')
.
I suspect the reason for this might be that his environment is set up in a different way, so that the /src/project
folder is treated as the working directory, while for me it is the root folder. But again, I don't know much about all of this, so please correct me if I'm wrong.
My question is, what is the right way to access the data/
directory? How would y'all handle it, if it was a public repository?
Any answers/suggestions (also regarding my structure in general) are appreciated. Thank you!