I have a directory structure as below
/home/damon/dev/python/misc/path/
/project/mycode.py
/app/templates/
I need to get the absolute path of the templates folder from mycode.py
I tried to write mycode.py as
import os
if __name__=='__main__':
PRJ_FLDR=os.path.dirname(os.path.abspath(__file__))
print 'PRJ_FLDR=',PRJ_FLDR
apptemplates = os.path.join(PRJ_FLDR,'../app/templates')
print 'apptemplates=',apptemplates
I expected the apptemplates to be
/home/damon/dev/python/misc/path/app/templates
but I am getting
/home/damon/dev/python/misc/path/project/../app/templates
How do I get the correct path?