iPython help, Docstring [source file open failed]

Discussion in 'Python' started by Kegan, Apr 14, 2009.

  1. Kegan

    Kegan Guest

    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.
    Kegan, Apr 14, 2009
    #1
    1. Advertising

  2. Kegan <> wrote:
    > 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.

    --
    R. David Murray http://www.bitdance.com
    R. David Murray, Apr 15, 2009
    #2
    1. Advertising

  3. Kegan

    alex23 Guest

    On Apr 15, 5:35 am, Przemyslaw Kaminski <> wrote:
    > 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?
    alex23, Apr 15, 2009
    #3
  4. Kegan

    P. Kaminski Guest

    On 15 Kwi, 03:27, alex23 <> wrote:
    > On Apr 15, 5:35 am, Przemyslaw Kaminski <> wrote:
    >
    > > 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?


    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.
    P. Kaminski, Apr 15, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bdb112
    Replies:
    3
    Views:
    254
    Chris Rebert
    Mar 9, 2009
  2. bdb112
    Replies:
    2
    Views:
    1,156
    Jason Scheirer
    Mar 12, 2009
  3. Tony Johansson
    Replies:
    3
    Views:
    16,111
    Patrice
    Jan 2, 2010
  4. Wolfram Brenig

    ipython -wthread vs. ipython -pylab

    Wolfram Brenig, Sep 12, 2011, in forum: Python
    Replies:
    0
    Views:
    323
    Wolfram Brenig
    Sep 12, 2011
  5. pat eyler
    Replies:
    1
    Views:
    437
    Masayoshi Takahashi
    Mar 5, 2005
Loading...

Share This Page