Revision 5 as of 2005-02-25 18:41:33

Clear message

Python Mode is a major editing mode for the EmacsEditor.

The [http://www.python.org/emacs/python-mode/python-mode.el current release] is version 4.6 (~123KB). The list of changes since the last released version [http://www.python.org/emacs/python-mode/changes-406.html are given in detail], as well as some [http://www.python.org/emacs/python-mode/installation.html installation notes.] If you're having problems with font-lock in python-mode, read the [http://www.python.org/emacs/python-mode/faq.html FAQ.]

Python Mode is part of the source distribution of Python (as the file Misc/python-mode.el) and a more recent version than the above release may be available through CVS.

See PythonMode for information on how to install, configure and add shortcuts keys to python-mode.

Python Mode FAQ

How can I run Uncomment Region?

The handy Uncomment Region command does not have a shortcut key. Actually, you can not run it from the command line at all! If you look into the python-mode description (C-h m), you will find that there is no such command.

There are (at least) three solutions:

;; The missing key shortcuts for Uncomment Region
  (add-hook 'python-mode-hook (lambda () 
    (define-key py-mode-map "\C-c3" 
      (lambda (beg end) (interactive "r")
        (py-comment-region beg end '(4))))))

Unable to edit the page? See the FrontPage for instructions.