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.path.dirname(os.path.abspath(__file__))
Should give you the path to a.
a
But if b.py is the file that is currently executed, then you can achieve the same by just doing
b.py
os.path.abspath(os.path.join('templates', 'blog1', 'page.html'))