We are working with a code repository which is deployed both to windows and linux, sometimes on different directories. How should one of the modules inside the project refer to one of the non-python resources in the project (CSV file, etc.)? If we do something like
thefile=open('test.csv')
or
thefile=open('../somedirectory/test.csv')
It will work only when the script is run from one specific directory, or a subset of the directories. What I would like to do is something like:
path=getBasePathOfProject()+'/somedirectory/test.csv'
thefile=open(path)
Is this the right way? Is it possible? Thanks