On Debian, you can simply install the package “python-mode,” but this describes the manual method.
For OS X (I currently use Snow Leopard), I can install the python-mode package via FinkCommander.
First, download python-mode.el and place it under ~/.emacs.d (create this directory if it does not exist).
Then add the following lines to your Emacs configuration file ~/.emacs:
(load “~/.emacs.d/python-mode.el”)
;;python
(setq auto-mode-alist (cons ‘(“\\.py$” . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons ‘(“python” . python-mode)
interpreter-mode-alist))
(autoload ‘python-mode “python-mode” “Python editing mode.” t)(global-font-lock-mode t)
(font-lock-mode +1)
That’s it.