Re: console command to get the path of a function

2009-12-20 Thread pograph
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

Re: console command to get the path of a function

2009-12-20 Thread Terry Reedy
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

Re: console command to get the path of a function

2009-12-20 Thread Dave Angel
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

Re: console command to get the path of a function

2009-12-20 Thread Peter Otten
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

Re: console command to get the path of a function

2009-12-20 Thread mattia
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

Re: console command to get the path of a function

2009-12-20 Thread mattia
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

Re: console command to get the path of a function

2009-12-20 Thread Irmen de Jong
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

console command to get the path of a function

2009-12-20 Thread mattia
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