Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs for Python programming: module/class outline/browser

I am currently using https://github.com/fgallina/python.el + ropemacs, but I am missing module browser: separate buffer that outlines names defined in the current module (list of classes with their methods). Google says that there are OO-browser and emacs-code-browser, but they looks outdated and I can't find any mentions about this libs in any of popular emacs + python tutorials. What should I use to achieve easy navigation across the module?

like image 439
Vladimir Mihailenco Avatar asked May 30 '11 19:05

Vladimir Mihailenco


People also ask

Is Emacs good for Python?

Emacs for Python Development With elpy. Emacs is ready out of the box to edit Python code. The library file python. el provides python-mode, which enables basic indentation and syntax highlighting support.

How do I run a Python program in Emacs?

Once you open your python file in Emacs, you will need to start the python process with: M-x run-python or C-c C-p , which creates an inferior python shell buffer. This buffer will be created by a horizontal split, and the active buffer will be the one containing the python file.

What software is needed for Python programming?

One of the best (and only) full-featured, dedicated IDEs for Python is PyCharm. Available in both paid (Professional) and free open-source (Community) editions, PyCharm installs quickly and easily on Windows, Mac OS X, and Linux platforms. Out of the box, PyCharm supports Python development directly.


2 Answers

I think ECB (Emacs Code Browser) is worth a try. I don't use it all the time but it can be very handy. Especially useful is the "ECB Methods" window which displays an outline of all members of a module.

Here is a screenshot with the ECB Methods window in the lower left corner: http://dev.pocoo.org/~gbrandl/emacs2.png.

See also http://www.emacswiki.org/emacs/EmacsCodeBrowser.

like image 175
mzjn Avatar answered Oct 16 '22 16:10

mzjn


Maybe occur can be helpful in this case. For example, if you want to list the defined functions: M-x occur RET def RET should visit a buffer where the def's are listed.

like image 6
Dror Avatar answered Oct 16 '22 16:10

Dror