Finding Script Directory

Steve Holden sholden at holdenweb.com
Wed Jul 7 16:04:37 EDT 2004


Peter Hansen wrote:
[...]
> Well, I just put that in a nice little .exe created by py2exe,
> and running from a directory in my PATH.
> 
> Amazing, but when I run it with the current directory set to C:\
> it prints only "C:\testpath", and yet the script (well, the EXE)
> is actually in a directory called c:\dev\prj189~1\dist ...
> 
> Fuzzyman's right: there isn't a clear, conclusive answer, I believe.
> 
> (But the above recipe, which I'm sure he found via google,
> should work in almost all cases, py2exe and perhaps certain OSes
> excluded.)
> 
> -but-that-doesn't-mean-i'm-not-getting-old-ly y'rs,
>  Peter

Happily it's still true that the fastest way to get the right answer on 
a newsgroup is to suggest the wrong one!

regards
  Steve



More information about the Python-list mailing list