Forcing Python to detect DocumentRoot

rusi rustompmody at gmail.com
Thu Jan 17 08:51:30 EST 2013


On Jan 16, 6:51 pm, Ferrous Cranus <nikos.gr... at gmail.com> wrote:
> When trying to open an html template within Python script i use a relative path to say go one folder back and open index.html
>
> f = open( '../' + page )
>
> How to say the same thing in an absolute way by forcing Python to detect DocumentRoot by itself?

Is this what you want?
import os
os.getcwd()



More information about the Python-list mailing list