[Tutor] Current path (of program)

Adrian Greyling adrian.greyling at gmail.com
Thu Sep 25 21:25:15 CEST 2008

I've been using "os.getcwd()" to get my program's "current path".  I know
it's actually returning my "current working directory", but it's been
working okay, until today...  I used py2exe (and InnoSetup) to create a
standalone executable (for Windows) and then a shortcut icon on the desktop
to "MyProg.exe".  Problem is, now "os.getcwd()" returns "C:\Documents and
Settings\ME\Desktop\" as it's current working directory, not the "C:\Program
Files\MyCoolProgram\" that I was expecting.

I'm trying to use a "relative path reference" so that the user can install
the program to whatever directory he/she wants, but that my program won't
"lose track" of the subdirectories it requires for additional files.

Anyone run into the same sort of problem?  Better yet, anyone know how to
solve this?

Thanks everyone!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080925/f08d6ed1/attachment.htm>

More information about the Tutor mailing list