Determine path of current module?

Carsten Gaebler cg at schlund.de
Thu Jul 20 04:21:12 EDT 2000


"Jürgen Hermann" wrote:

> ### mypath.py
> import sys
> print sys.modules[__name__].__file__
> 
> [d:\tmp]python -c "import mypath"
> mypath.py

Well, that's just the filename. What I'm looking for is the complete path,
"d:\tmp\mypath.py" in this case.

Carsten.



More information about the Python-list mailing list