python with braces pre-processor

Ant antroy at gmail.com
Mon Oct 22 05:51:58 EDT 2007


On Oct 22, 10:44 am, Paul Brauner <paul.brau... at loria.fr> wrote:
> Hi, I'm working on a project that outputs several languages including
> (hopefully) python. My problem is that the generic backend architecture
> has not been designed to output correctly indented code, and that would
> be helpful if there were somewhere a python pre-processor that would take
> python with braces as an input and output regular python code. I thought
> that it must exists because everyone generating python code will
> encounter more or less the same problem, but I didn't find any 'official'

There's a tool in the standard Python distribution that processes code
with commented end statements. eg:

def my_funct():
pass
# end


or similar, and indents it correctly. This may be a possibility for
your purposes.






More information about the Python-list mailing list