I am having some trouble using a class I have created which includes a function that calls a folder of geojson files. The folder lives in the same directory as the .py file with the class and it is very important that I do not provide the full path for this folder.
If I do provide the full path, the function works perfectly. However, this is a shared folder with other users and for this reason, we need to keep the folder path like './geo_first_division'
.
In more detail, I provide a scheme of the folders below and the folder named as "classes_folder" is the shared one. The file "class_geo.py" has a function within, say fun1()
, which needs the content of the folder "geo_first_division".
The "app.py" is within the "app_folder" and although it works perfectly for all the functions within the class, it will break for the fun1()
giving an error [Errno 2] No such file or directory: './geojson_first_division'
.
There must be something that I do not see clearly here and I would appreciate some help.