Starter Kit Python

This is part of the Emacs Starter Kit.

Starter kit Python

Support for the Python programming language.

Check Dependencies

Determine whether required packages are installed. If not, use ELPA to install them.

(starter-kit-install-if-needed 'python-mode 'ipython)

Use Python's python-mode.el instead of Emacs' python.el

Replace the Python mode that comes with Emacs by the Python mode supplied by the Python distribution itself.

(require 'python-mode)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))

Use Cython mode

(when (require 'cython-mode nil 'no-error)
  (add-to-list 'auto-mode-alist '("\\.pyx\\'" . cython-mode))
  (add-to-list 'auto-mode-alist '("\\.pxd\\'" . cython-mode))
  (add-to-list 'auto-mode-alist '("\\.pxi\\'" . cython-mode)))