Python Source Code (re)formatter ?

Steve Holden sholden at holdenweb.com
Thu Jan 10 10:05:51 EST 2002


"Paul Rubin" <phr-n2002a at nightsong.com> wrote in message
news:7xzo3mclbl.fsf at ruckus.brouhaha.com...
> Michael 'Mickey' Lauer <mickey at tm.informatik.uni-frankfurt.de> writes:
> > I have written a bunch of Python source code which will be included
> > in a book. Unfortunately, the listing area has only 55 columns.
> > Many lines in my source code are longer than 55 columns.
> > Do you know of a source reformatting utility which reformats python code
> > to use a limited number of columns without messing the syntax or
> > semantics ?
>
> Yuck.  Use a smaller font and more columns.

Unfortunately. :M:'s publisher may have already-established stylistic rules
about code listings, and his work might be expected to conform to existing
series standards. Plus older readers, tending towards long sight, might not
thank you for the smaller font.

For my own book I was fortunate enough to work with a Python-friendly
publisher (New Riders), so I was able to submit line-numbered listings with
continuations indicated by a slash at the end of the continued line and the
absence of a line number on the continuation.

Of course we'll have to wait until it's published to verify this approach
has worked, but the proofs didn't seem to have that much wrong with them.

nothing-wrong-with-my-eyes-but-my-arms-are-too-short-ly y'rs  - steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list