mku wrote:
> Hi,
> 
> thereĀ“s a function inside a module. How can these function retrieve
> the path+name   of his module ? (The path is most important).
> That should also work if the module is part of a package.
> 
> Thanks in advance
> 
> Martin
> 

Try the following in the function:

import traceback
f = traceback.extract_stack(limit=2)

If you output f to the interpreter, you'll see the filename but I don't 
know what position in the output list it is guaranteed to be.

Jim
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to