Non-Indented python

Michael Hudson mwh at
Thu Nov 22 17:59:03 CET 2001

philh at (phil hunt) writes:

> For C there is a program (I think it's called indent) that re-does
> the indentation of a source code file according to defined criteria.
> Perhaps there should be somertyhing similar for python? When someone
> checks code out of CVS it could automatically indent it the way the
> user desired, and when checking basck in to CVS, indent it according
> to the project standards.
> Does anything like this exist?

I'm pretty sure python-mode in emacs will reindent chunks of code to
different indentation levels, although I don't recall how to get it to
do this.  There's also Tim Peter's, which lives in
Tools/scripts/ in CVS which will convert Python to the One True
Indentation Format, i.e. the one recommended in PEP 8.  It could
probably be rigged to do other formats too - but that would be heresy


  C is not clean -- the language has _many_ gotchas and traps, and
  although its semantics are _simple_ in some sense, it is not any
  cleaner than the assembly-language design it is based on.
                                        -- Erik Naggum, comp.lang.lisp

More information about the Python-list mailing list