On Sunday, 19 August 2012 01:19:59 UTC+10, kj wrote:
> What's the most reliable way for "module code" to determine the
> absolute path of the working directory at the start of execution?
Here's some very simple code that relies on the singleton nature of modules
that might be enough for your nee
On Sat, Aug 18, 2012 at 11:19 AM, kj wrote:
>
> 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
What's the most reliable way for "module code" to determine the
absolute path of the working directory at the start of execution?
(By "module code" I mean code that lives in a file that is not
meant to be run as a script, but rather it is meant to be loaded
as the result of some import statement