console command to get the path of a function
Irmen de Jong
irmen.NOSPAM at xs4all.nl
Sun Dec 20 07:53:18 EST 2009
On 12/20/2009 1:45 PM, 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
something like this?
>>> import inspect
>>> import os
>>> inspect.getsourcefile(os.path.split)
'C:\\Python26\\lib\\ntpath.py'
>>> print inspect.getsource(os.path.split)
def split(p):
"""Split a pathname.
...
...
--irmen
More information about the Python-list
mailing list