how to get the parent dir location using python..

Posted by zjm1126 on Stack Overflow See other posts from Stack Overflow or by zjm1126
Published on 2010-05-12T08:57:45Z Indexed on 2010/05/12 9:24 UTC
Read the original article Hit count: 191

Filed under:
|
|

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'))

but i want to get the parent dir location:

a
|---b.py
    |---templates
           |--------blog1
                      |-------page.html

and how to get the a location

thanks

© Stack Overflow or respective owner

Related posts about python

Related posts about path