Any python code prettifiers out there?

Ryan Golden ryang at synthesys.com
Wed May 3 23:22:10 CEST 2000


On 03 May 2000 09:46:41 -0400, Alex <cut_me_out at hotmail.com> wrote:

>
>> Have you looked at the standard 'pprint' module?
>
>That's for printing out complex data structures.  It wouldn't help very
>much for formatting python code.
>
>Alex.

Thanks for your input.  However, as Alex noted, this module does not
appear to be suitable for formatting source code.  I'm looking for
something that might:

1) line up consecutive assignment statements

2) change tab width throughout an entire file to a specified value

3) enforce spacing conventions for all sequence types and
function/method parameters, e.g., [1,2,3] to [ 1, 2, 3 ]

4) change where possible the kind of string quotation mark (single or
double) used in your code to a specified kind.

5) format all the comments in the code a certain way, and

6) perhaps allow me to resize the overall width of the code


I suppose I could attempt to make my own tool, but I'm not a regular
expression guru, and was wondering if there were any tools already
available.  I would certainly find it useful.

Can any cronies tell me if this tool does or does not exist?

Thanks again,

--Ryan



More information about the Python-list mailing list