3

How can I get the python document in Emacs.I list two ways.

1、Using the man command?But I don't know where to download man file.

2、Some people suggest me to use dash in Emacs.What's dash.I can't find dash-mode in Emacs.

Ehvince
  • 17,274
  • 7
  • 58
  • 79
noah_le
  • 79
  • 1
  • 7
  • 2
    What is a "Python document"? The rest of the question makes no sense, either. – DYZ Sep 01 '17 at 03:28
  • Why my question makes no sense?I am a Emacser,I want to do all my work in Emacs.I want to search the python Documentation in Emacs. – noah_le Sep 01 '17 at 03:37
  • 1
    @noah_le in the title "python document" makes no sense. "I want to search the python documentation" is clearer. What did you try so far ? Did you google for "emacs dash" ? It's an elisp library, not needed here. Also, do you usually read python documentation with man pages ? – Ehvince Sep 01 '17 at 09:06

2 Answers2

5

Both Elpy and Anaconda-mode have ways of looking up Python documentation:

In Elpy: https://elpy.readthedocs.io/en/latest/ide.html#command-elpy-doc

In Anaconda-mode: https://github.com/proofit404/anaconda-mode#eldoc

I have used both these packages in the past, and both are great!

elethan
  • 16,408
  • 8
  • 64
  • 87
1

I generated the Python docs in info format and use the info reader in Emacs. The Python documentation is spread out and the info reader is great at bringing those disparate pieces together.

The first step is to get a copy of the Python documentation in info format. The Python project does a great job making it easy to generate it (the info files themselves probably aren't distributed because the rst-to-info conversion isn't perfect). I detailed how to generate the Python docs in info yourself in this response. The process and the resulting info files are also hosted here.

To read an info file in Emacs, use C-u C-h i to be prompted for the file path. If you have the info file installed on your system (detailed here), you can use C-u 2 C-h i (or any other number, 3, 4, 5, etc.) to open a separate info buffer. This allows you to have multiple copies open side by side.

You can search the entire manual forward using C-s and backward with C-r. Use m to goto a menu item; press tab to see completions. Similarly, use g to jump to a node. You can press tab on a page to move the cursor the the next link. Use, l for the last page, u to move up a node, t to go to the "top" of the manual. Running info-apropos will generate a menu of all places in the manual that contain a search term. Execute M-: (Info-goto-node "(info)") to visit the Emacs info manual (which is somewhat different from the standalone info reader). The info reader has a lot of helpful commands!

Lorem Ipsum
  • 4,020
  • 4
  • 41
  • 67