On Tue, Oct 29, 2013 at 1:49 AM, Grant Edwards <invalid@invalid.invalid> wrote: > On 2013-10-27, Chris Angelico <ros...@gmail.com> wrote: >> 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.
For installed programs, maybe; but we run a lot of scripts out of source control, like a sanity checker that gets run immediately before a commit. Some of them need data files that are also source-managed, so we have them in the same directory. Locating those files is usually easiest done by tailing onto the script's path. ChrisA -- https://mail.python.org/mailman/listinfo/python-list