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.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1.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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:Function': 0.09; 'subject:script': 0.09; 'cc:addr:python-list': 0.11; 'attribute.': 0.16; 'do,': 0.16; 'module': 0.19; 'pfxlen:0': 0.19; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'cc:2**0': 0.24; 'header :In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'file': 0.32; 'subject:the': 0.34; 'received:google.com': 0.35; 'subject:?': 0.36; 'level': 0.37; 'to:addr:gmail.com': 0.65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Vni3gWUS3ycl9sbw/GrZitzJtaD31FMulIL6rI/tGr0=; b=Fmt60J1bxxxqYygIqDKcOBHDtsdLgoQzMnIlYvagdjpSUh2ZeR3dLNgQ3eNvl1WP3w CUf1oMjXIdmGTnJhAFBkl30CL6wtinsIjbcsv8XAD+iDU2FTSiCZBeXWh3Lao4pR2p3l iQIQ6C8RzqP8/w9NBHLK5eKZNIrJtju7hEWaOoBloi3Ry2ELBhmcT+TYWFQSv2/zWVOC 37fjll7hCUUnVNVeESvgnZtz+7La/ORAtCek0nJ75HArfhTqb1DZy/Eru1SC2gDNGzgk kyeUj08bMpyr6PJk4T/4JFplaN5jh6lUuy+uR8DC7MR1/Lax7bw90jBkhkBBhZ4PQHPx OWfA== MIME-Version: 1.0 X-Received: by 10.50.97.7 with SMTP id dw7mr4015457igb.2.1382841749215; Sat, 26 Oct 2013 19:42:29 -0700 (PDT) In-Reply-To: <00704f33-7e7f-4ccf-b28b-69776d2e237d@googlegroups.com> References: <00704f33-7e7f-4ccf-b28b-69776d2e237d@googlegroups.com> Date: Sat, 26 Oct 2013 21:42:29 -0500 Subject: Re: Function for the path of the script? From: Skip Montanaro To: Peter Cacioppi Content-Type: multipart/alternative; boundary=047d7b10c8533e205904e9afef6c Cc: Python 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382841758 news.xs4all.nl 15891 [2001:888:2000:d::a6]:35171 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57706 --047d7b10c8533e205904e9afef6c Content-Type: text/plain; charset=UTF-8 Strange. I almost never want to know the location of the file that's executing, and when I do, I just reference the __file__ module level attribute. Skip --047d7b10c8533e205904e9afef6c Content-Type: text/html; charset=UTF-8

Strange. I almost never want to know the location of the file that's executing, and when I do, I just reference the __file__ module level attribute.

Skip

--047d7b10c8533e205904e9afef6c--