How to read the directory which the actively running python file is located in?

anders anders.u.persson at gmail.com
Fri Dec 1 07:13:52 EST 2006


in os module there is many funktion/methods to extract this information
to ask the path to the current running pythonprogram you can do likes
this

----- CUT-----------
import os
print os.getcwd()

----- CUT ------

// Anders


Michael Malinowski skrev:

> Is there a way to read the directory that the currently running python file
> is located in?
> Cheers
> Mike.




More information about the Python-list mailing list