jason.swails at gmail
Aug 18, 2012, 1:53 PM
Post #2 of 3
On Sat, Aug 18, 2012 at 11:19 AM, kj <no.email [at] please> wrote:
Re: How to get initial absolute working dir reliably?
[In reply to]
> Basically, I'm looking for a read-only variable (or variables)
> initialized by Python at the start of execution, and from which
> the initial working directory may be read or computed.
This will work for Linux and Mac OS X (and maybe Cygwin, but unlikely for
native Windows): try the PWD environment variable.
>>> import os
Of course this environment variable can still be messed with, but there
isn't much reason to do so generally (if I'm mistaken here, someone please
Hopefully this is of some help,