Python.el shell and runtime buffer

I am using python.el from fgallina python.el github There is a long list of functions, but I do not know how to use them.

EDIT: found this mode worked, but did not automatically open the interpreter, sent information there. How can I send / download the current current python buffer for evaluation? I am trying to use Cc Cc, but I am not getting any output.

Python shell integration and shell completion? Do I need to add something next to the standard cursor and does this require instructions?

Imenu support is not shown to me either. Edit I tried adding this to my emacs, but it didnโ€™t work.

add-hook 'python-mode-hook 'imenu-add-menubar-index) 

I am using emacs 23 on ubuntu

+4
source share
1 answer

For your first question: Usually you can upload a buffer / file using Cc Cl. (Just tested this for python.el, and it works for that too). This will send the file to the lower python process, so you have to open the * Python * buffer to see the results. The * Python * buffer is also your usual python / shell / REPL interpreter. CMx is bound to python-send-defun, which sends the method / function definition to the interpretation process. For other bindings, just click Mx describe-bindings, and then find โ€œpython-โ€ (in the โ€œBasic Mode Bindingsโ€ section) in the help buffer window * that opens.

There are some more docs at the beginning of python.el if you want to know more about completion:

Quote:

Shell Completion: The hit tab will attempt to complete the current word. The completion of the shell is done in such a way that if you change the python-shell-interpreter to any other (like IPython), it should be easy to integrate another way of calculating the completion. You just need to specify your custom python-shell-completion-setup-code and python-shell-completion-string-code .

Quote:

Symbol Completion: You can fill the symbol at a point. It uses shell completion in the background so that you run python-shell-send-buffer from time to time to get the best results.

Skeletons: there are 6 skeletons, def, for, if, try, and while, for simple class insertion. These skeletons are integrated with dabbrev. If you activated dabbrev-mode and python-skeleton-autoinsert set to t, then whenever you enter the name of any of those that are defined and fall into the SPC, they will automatically expand.

The imenu entry is displayed to me without adding a hook, just (require 'python) in the configuration file.

+6
source

All Articles