Path ... where is my application's home dir?
Peter Hansen
peter at engcorp.com
Wed Apr 28 10:06:17 EDT 2004
Batista, Facundo wrote:
> [Marco Aschwanden]
>
> #- I want to store a file in the application directory. What is
> #- the easiest
> #- way to figure out, where my application is situated?
>
> You don't need that, just save it without a path and it'll fall in your
> current directory.
But what if the current directory is not the same as "where my
application is situated"?
> But if you need it for something else:
>
> >>> import os.path
> >>> os.path.curdir
> '.'
> >>> os.path.abspath(os.path.curdir)
> 'C:\\temp'
That looks a lot like a complicated way to spell 'os.getcwd()' :-)
More information about the Python-list
mailing list