this code is get the templates/blog1/page.html in b.py:
path = os.path.join(os.path.dirname(__file__), os.path.join(\'templates\', \'blog1/page.html\'))
os.pardir is a better way for ../ and more readable.
os.pardir
../
import os print os.path.abspath(os.path.join(given_path, os.pardir))
This will return the parent path of the given_path