iPython help, Docstring [source file open failed]

K

Kegan

I use iPython installed from macport. When I am in the iPython shell,
I do the following:


In [8]: from datetime import timedelta

In [9]: timedelta??
Type: type
Base Class: <type 'type'>
String Form: <type 'datetime.timedelta'>
Namespace: Interactive
File: /opt/local/Library/Frameworks/Python.framework/
Versions/2.5/lib/python2.5/lib-dynload/datetime.so
Docstring [source file open failed]:
Difference between two datetime values.


Lets say I want more information about timedelta right at the shell
(as oppose lookup at Python Doc). Can I somehow link the actual Python
source code to iPython so that it can be accessed in that way?

I am using macport. Please help.
 
R

R. David Murray

Kegan said:
I use iPython installed from macport. When I am in the iPython shell,
I do the following:


In [8]: from datetime import timedelta

In [9]: timedelta??
Type: type
Base Class: <type 'type'>
String Form: <type 'datetime.timedelta'>
Namespace: Interactive
File: /opt/local/Library/Frameworks/Python.framework/
Versions/2.5/lib/python2.5/lib-dynload/datetime.so
Docstring [source file open failed]:
Difference between two datetime values.


Lets say I want more information about timedelta right at the shell
(as oppose lookup at Python Doc). Can I somehow link the actual Python
source code to iPython so that it can be accessed in that way?

Notice that the filetype is '.so'. That means it is a compiled
C module, so there is no python source to view.
 
A

alex23

You may want to try:
import pydoc
b = pydoc.render_doc(timedelta)
print b

Isn't this exactly the same output you get from typing 'help
(timedelta)' though?
 
P

P. Kaminski

Isn't this exactly the same output you get from typing 'help
(timedelta)' though?

Well, from this:

Lets say I want more information about timedelta right at the shell
(as oppose lookup at Python Doc).

I understood that Kegan wanted python documentation, as in help, but
without the pager, right at the shell. Correct me if I'm wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top