If you’re a python programmer, you probably know all about the troubles mixing tabs and spaces can cause. I have searched far and wide, and have collected some really useful configurations for setting up the perfect Emacs configuration for Python.
What it does:
Insert spaces instead of tabs when indenting
Sets indent to 4 spaces when in python mode & SGML (superset of HTML) mode. This is useful for the web developers out there.
Highlight tabs and trailing whitespace (thanks to http://www.emacswiki.org/emacs/highlight-chars.el)
via Tabs, Whitespaces, and Highlighting in Emacs – for the Python Programmer.