Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.nosignal.org!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'that?': 0.05; 'defines': 0.07; 'scripts': 0.09; 'python': 0.09; 'script,': 0.09; 'itself.': 0.11; 'apache': 0.13; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'wrote:': 0.17; 'specifies': 0.17; 'variables': 0.17; 'variable': 0.20; 'user.': 0.23; 'linux': 0.24; 'script': 0.24; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'convention': 0.27; 'module.': 0.27; 'environment': 0.29; 'cgi': 0.29; 'host.': 0.29; 'this.': 0.29; 'sense': 0.31; 'point': 0.31; 'not.': 0.32; 'running': 0.32; 'docs': 0.33; 'to:addr:python- list': 0.33; "can't": 0.34; 'exist': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'message-id:@gmail.com': 0.36; 'operating': 0.36; 'subject:: ': 0.38; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'called': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'information': 0.63; 'home': 0.66 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Mon, 21 Jan 2013 08:46:35 -0700 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121115 Thunderbird/10.0.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Forcing Python to detect DocumentRoot References: <339d9d6d-b000-4cf3-8534-375e0c44b2ca@googlegroups.com> <10ebf68d-12f9-46d6-be50-6c314500302d@googlegroups.com> In-Reply-To: <10ebf68d-12f9-46d6-be50-6c314500302d@googlegroups.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358783208 news.xs4all.nl 6849 [2001:888:2000:d::a6]:58567 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37206 On 01/18/2013 06:02 AM, Ferrous Cranus wrote: > Yes my Python scripts exist in a linux web host. > > os.environ['HOME'] will indeed give the home directory of the user. > > to me /home/nikos/ > > but i want a variable to point to > > /home/nikos/public_html whice is called DocumentRoot. Not it's not. There is nothing in the operating system that defines this. > is there avariable for that? i can't seem to find any... Not there's nothing in the operating system that specifies this. This is a convention that makes sense only to the apache daemon itself. If your python script is running as a CGI script, then apache will set environment variables that you can read with the os module. See the Apache docs for information on this.