I have a file structure like this:
data mydata.xls scripts myscript.py
From within myscript.py, how can I get the filepath of mydata.
import os directory = os.path.dirname(os.getcwd()) final = os.path.join(directory, 'data', 'mydata.xls')
or simply
os.path.abspath('../data/mydata.xls')