Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Function for the path of the script? Date: Mon, 28 Oct 2013 14:49:56 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 22 Message-ID: References: <00704f33-7e7f-4ccf-b28b-69776d2e237d@googlegroups.com> <526C7FEF.7020206@islandtraining.com> NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1382971796 9996 64.122.56.22 (28 Oct 2013 14:49:56 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 28 Oct 2013 14:49:56 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:57832 On 2013-10-27, Chris Angelico wrote: > On Sun, Oct 27, 2013 at 1:52 PM, Gary Herron > wrote: >> Huh? In what kind of a workflow are you running a python file without >> knowing *what* file you are runnung? I've been writing Python programs for 10+ years. Never have I felt a need to know the location of the file that's running. I do sometimes want to know the _name_ of the file (for multipurpose programs), but I don't ever remember caring where that file was. > It's very common to want to know what directory you're in - it's a > good way to find data files. From a Unix point of view, that's also very wrong. Data files don't belong in the same directory as the executable. -- Grant Edwards grant.b.edwards Yow! Is this an out-take at from the "BRADY BUNCH"? gmail.com