Skip to content

Add a help() viewer for IDLE's Shell. #57868

Closed

Description

@RamchandraApte
BPO 13659
Nosy @terryjreedy, @ezio-melotti, @serwy
Superseder
  • bpo-1529353: Squeezer - squeeze large output in IDLE's shell
  • Files
  • help_pager.diff
  • issue13659.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-02-20.23:59:18.045>
    created_at = <Date 2011-12-24.06:23:34.488>
    labels = ['expert-IDLE', 'type-bug']
    title = "Add a help() viewer for IDLE's Shell."
    updated_at = <Date 2019-02-20.23:59:18.044>
    user = 'https://bugs.python.org/RamchandraApte'

    bugs.python.org fields:

    activity = <Date 2019-02-20.23:59:18.044>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-02-20.23:59:18.045>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2011-12-24.06:23:34.488>
    creator = 'Ramchandra Apte'
    dependencies = []
    files = ['25491', '27817']
    hgrepos = []
    issue_num = 13659
    keywords = ['patch']
    message_count = 12.0
    messages = ['150214', '150218', '150279', '150392', '150413', '150424', '160114', '160182', '174260', '174372', '179870', '336155']
    nosy_count = 6.0
    nosy_names = ['terry.reedy', 'ron_adam', 'ezio.melotti', 'roger.serwy', 'Ramchandra Apte', 'tomkeus']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = '1529353'
    type = 'behavior'
    url = 'https://bugs.python.org/issue13659'
    versions = ['Python 3.4']

    Activity

    1. RamchandraApte commented on Dec 24, 2011

      RamchandraAptemannequin
      MannequinAuthor

      If you call help() a few times on some objects, due to help()'s output IDLE's Shell Window becomes very long and it becomes difficult to scroll through the window.

      I suggest a new window should be opened when help() is called in IDLE so that no help output comes in the IDLE Shell Window.

      This bug doesn't affect the Python command-line on Linux (and I think Mac OS X) since help() uses the less program to display the help output.

    2. added
      type-feature
      on Dec 24, 2011
    3. RamchandraApte commented on Dec 24, 2011

      RamchandraAptemannequin
      MannequinAuthor

      Sorry, new window in "I suggest a new window" should be a new read-only editor window.
      It could be implemented through a wrapper around help.
      IDLE could have a configuration option whether to use the traditional help() or the new help() which opens a new window.

    4. serwy commented on Dec 28, 2011

      serwymannequin
      Mannequin

      If you're on Linux, run this as your first command in IDLE:

          import pydoc; pydoc.pager = lambda text: pydoc.tempfilepager(pydoc.plain(text), 'xterm -e less')

      If Windows:

          import pydoc; pydoc.pager = lambda text: pydoc.tempfilepager(pydoc.plain(text), 'notepad')

      All help() output for objects will now display outside of IDLE.

      The Squeezer extension does something similar for output that is longer than 30 lines.

      It should be possible to create a custom pager for the subprocess which communicates with IDLE to display this text. RPCProxy could be used to accomplish this in conjunction with the textView module.

    5. terryjreedy commented on Dec 30, 2011

      @terryjreedy
      Member

      I should like it if a separate window were either automatic or a configuration option for help on modules and classes, which should cover 'long' output. The Windows workaround, which I will never remember, brings up an extraneous cmd.exe window in addition to notepad.

    6. ronadam commented on Dec 31, 2011

      ronadammannequin
      Mannequin

      What about having idle open a web browser session with pydocs new browse option?

      python3 -m pydoc -b

      We've added input fields to the pages that take the same input as help() command does. It also links to the online help pages, and you can view the source code of the files directly in the browser. (Sometimes that's the best documentation you can get.)

    7. terryjreedy commented on Dec 31, 2011

      @terryjreedy
      Member

      I would like that to be a help() option, such as help(module, -b) or more verbosely, help(module, browser=True). This would be useful for the regular interactive interpreter as well.

    8. ezio-melotti commented on May 6, 2012

      @ezio-melotti
      Member

      I don't think adding a "browser" arg to help() is a good idea.
      The original suggestion of having the help in a separate window and adding a checkbox in the options to (de)activate the feature sounds good to me (it could even allow to select between normal/new window/browser).

    9. serwy commented on May 8, 2012

      serwymannequin
      Mannequin

      Attached is an initial diff for creating a separate pager window by using a textView widget. The recently applied patch in bpo-964437 allows this window to be non-modal, which can be useful for interactive development.

      The diff contains code to allow the pager to work with and without a subprocess. The "pager" and "use_help_window" in PyShell.py provide the core functionality. The "use_help_window" presently is a placeholder for implementing Ezio's suggestion in msg160114.

      Does anyone know why "import pydoc" is wrapped in a try/except block? I omitted that in "pager".

    10. RamchandraApte commented on Oct 31, 2012

      RamchandraAptemannequin
      MannequinAuthor

      Bump.

    11. serwy commented on Oct 31, 2012

      serwymannequin
      Mannequin

      The attached patch ("bpo-13659.patch") adds a configuration option for selecting the output of help() as being in the shell or in the pager. It is an enhancement against 3.4.

      Another possibility involves adding a checkable menu item under "Options" or "Help" to enable/disable the help pager.

      Please review.

    12. RamchandraApte commented on Jan 13, 2013

      RamchandraAptemannequin
      MannequinAuthor

      Patch LGTM.

    13. added
      type-bug
      and removed
      type-feature
      on Jun 3, 2014
    14. terryjreedy commented on Feb 20, 2019

      @terryjreedy
      Member

      bpo-1529353 added squeezer, making this alternative unnecessary. Once squeezed, output can be opened in a text viewer.

    15. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      topic-IDLEtype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions