Forcing Python to detect DocumentRoot

Roy Smith roy at panix.com
Thu Jan 17 15:09:02 CET 2013


In article <339d9d6d-b000-4cf3-8534-375e0c44b2ca at googlegroups.com>,
 Ferrous Cranus <nikos.gr33k 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?

Can you give us more details of what you're doing.  Is there some web 
framework you're using?  Can you post some code that's not working for 
you?



More information about the Python-list mailing list