On Dec 20, 12:02 pm, Terry Reedy 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 .../Py
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
--
http://mail.python.org/mailman/lis
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
mattia wrote:
> Il Sun, 20 Dec 2009 13:53:18 +0100, Irmen de Jong ha scritto:
>
>> 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 th
Il Sun, 20 Dec 2009 13:53:18 +0100, Irmen de Jong ha scritto:
> 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 inspe
Il Sun, 20 Dec 2009 13:53:18 +0100, Irmen de Jong ha scritto:
> 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 inspe
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\\ntpa
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
--
http://mail.python.org/mailman/listinfo/python-list