Emacs python-mode

I am trying to configure Emacs23.2 to work with python2.7.3 using the python-mode.el-6.0.7 package

After adding these LISP lines to my .emacs file, as instructed by INSTALL, ...

(add-to-list 'load-path "PATH/TO/PYTHON-MODE/") (setq py-install-directory "PATH/TO/PYTHON-MODE/") (require 'python-mode) 

... I open the file foo.py, and until it is all found: python is recognized, the syntax is highlighted, and emacs works well.

But I have a suspicion that I'm missing something or something is wrong ... Basically, because the python-mode package has a few more things to use with python & emacs like pycomplete, pymacs and etc ... it looks like they don't work together when I open emacs and python.

Does anyone know how to properly configure this package so that everything works together correctly?

Any (personal) suggestion is welcome, as I am not a professional with emacs ...!

+8
python emacs configure python-mode
source share
6 answers

(I think someone will give a better answer, but ...)

The documentation for supporting Python in EmacsWiki was pretty messy, partly because there were two different main modes to choose from, and the information for each was mixed with the same page.

Since I first came across it, it has been very cleaned up, so I hope it is not too confused, and you will find what you need with one of the following:

+8
source share

current python-mode.el comes with an extended menu: PyEdit, PyExec, etc.

https://launchpad.net/python-mode/+download

See also the doc commands-python-mode.org section, respectively. Commands-python-mode.rst

Other questions can be sent to https://answers.launchpad.net/python-mode

+2
source share

These are the relevant lines from my init.el:

(setq py-install-directory "~ / .emacs.d / site- lisp / python-mode.el-6.1.1")

(add to the list "py-install-directory boot path")

(requires "python-mode")

Download the latest python-mode from Launchpad and tell Emacs in your init.el where you can find it. (see above)

If your main mode says Py , you use pyhon-mode.el, if it says Python , then you use python.el inline mode.

For autocompletion you should try Jedi , this is a very good completion library for python.

You can configure python mode through very complete menu entries or through

Mx customize-mode .

+2
source share

Among the advanced functions of python-mode I use only

 (add-hook 'python-mode-hook (lambda () (define-key python-mode-map (kbd "Cc |") 'py-execute-region-ipython))) 

send scope in ipython using Cc | .

+1
source share

I can fully recommend anaconda-mode . This gives you automatic completion, documentation search, switching to ++ source. Together with pyflakes, flymake, auto-full-mode and a shell, Emacs creates an excellent Python development environment.

Easy to configure too, you can only start with these two lines: (add-hook 'python-mode-hook 'anaconda-mode) (add-hook 'python-mode-hook 'ac-anaconda-setup)

+1
source share

I suggest using another python-el like

https://github.com/fgallina/python.el

0
source share

All Articles