console command to get the path of a function

pograph wangpurui at yahoo.com.cn
Sun Dec 20 15:40:42 EST 2009


On Dec 20, 12:02 pm, Terry Reedy <tjre... at udel.edu> wrote:
> On 12/20/2009 7:45 AM, 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?).
>
> On Windows and I believe other systems, for the stdlib, 'import x'
> imports .../Pythonx.y/Lib/x

Not always. For example, os.path is actually in one of ntpath.py,
posixpath.py, or macpath.py.



More information about the Python-list mailing list