Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '16,': 0.03; 'subject:Python': 0.05; 'python': 0.09; 'forcing': 0.09; 'cc:addr :python-list': 0.10; 'template': 0.11; 'index.html': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'detect': 0.17; 'jan': 0.18; 'email addr:gmail.com>': 0.20; 'question.': 0.20; 'trying': 0.21; 'cc:2**0': 0.23; 'absolute': 0.23; 'script': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'url:mailman': 0.29; 'folder': 0.30; 'relative': 0.30; 'url:python': 0.32; 'url:listinfo': 0.32; 'received:google.com': 0.34; 'path': 0.35; 'open': 0.35; 'received:209.85': 0.35; 'url:org': 0.36; 'url:library': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'page': 0.38; 'url:mail': 0.40; 'think': 0.40; 'your': 0.60; 'here:': 0.62; 'back': 0.62; 'within': 0.64; '2013': 0.84; 'itself?': 0.84; 'url:path': 0.84; 'joel': 0.91; 'to:none': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:cc:content-type; bh=xE99BkDhlsVCHU7SMbPJM/YuPapBV1AIviOG1AADkb0=; b=aOVUN/5Isrj7DbeNoKHO6/TUUW66mNi1N8yNgUGebkOTwMyWwNwy+r6wLHRwh4+l8J nBefcv739Y+0uEdRSldeGGEHUp3pmFotmWM4pP5AsuvUVsCKL5hnU0PRq4Im1KFwZUDR 8Wneu+8BwW1vLKPmNBOTHh8hxDGgGprT+kgBn0ths/6+SYRzrzvjHdmxLOnQ8L1oJLvR 3YO8mcbYmK16jAiA/PieFNFZtE93CD5ctOpTXztX5fTJS/XkQSnUvA9+iVekW6+trASM A3QkXI3xJlaEvagCCXUcc962TrF2LaI4AUI8aWuJOZAEDX4i+ryECWjBWmXRWhIryPt0 UAWA== MIME-Version: 1.0 X-Received: by 10.221.2.11 with SMTP id ns11mr1220747vcb.3.1358344867684; Wed, 16 Jan 2013 06:01:07 -0800 (PST) In-Reply-To: <339d9d6d-b000-4cf3-8534-375e0c44b2ca@googlegroups.com> References: <339d9d6d-b000-4cf3-8534-375e0c44b2ca@googlegroups.com> Date: Wed, 16 Jan 2013 09:01:07 -0500 Subject: Re: Forcing Python to detect DocumentRoot From: Joel Goldstick Cc: "python-list@python.org" Content-Type: multipart/alternative; boundary=bcaec54ee7d852211504d3684f93 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 54 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358344869 news.xs4all.nl 6850 [2001:888:2000:d::a6]:36383 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36893 --bcaec54ee7d852211504d3684f93 Content-Type: text/plain; charset=UTF-8 On Wed, Jan 16, 2013 at 8:51 AM, Ferrous Cranus 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? > -- > http://mail.python.org/mailman/listinfo/python-list > I don't think I understand your question. But, I think your answer is here: http://docs.python.org/2/library/os.path.html -- Joel Goldstick http://joelgoldstick.com --bcaec54ee7d852211504d3684f93 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Wed, Jan 16, 2013 at 8:51 AM, Ferrous Cranus &= lt;nikos.gr33k@g= mail.com> wrote:
When trying to open an ht= ml template within Python script i use a relative path to say go one folder= back and open index.html

f =3D open( '../' + page )

How to say the same thing in an absolute way by forcing Python to detect Do= cumentRoot by itself?
--
http://mail.python.org/mailman/listinfo/python-list

I don= 't think I understand your question.=C2=A0 But, I think your answer is = here: http://docs= .python.org/2/library/os.path.html

--
--bcaec54ee7d852211504d3684f93--