console command to get the path of a function

Dave Angel davea at ieee.org
Sun Dec 20 10:34:46 EST 2009



mattia wrote:
> Hi all, is there a way in the python shell to list the path of a library 
> function (in order to look at the source code?).
>
> Thanks, Mattia
>
>   
If you know what module it's in, you can use
     themodule.__file__

But realize that this will only work if the module has been imported, 
and might not if the module is implemented in C.

DaveA



More information about the Python-list mailing list