Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
BraceConverter.py

Contributed 2000-09-04 by Dave Wallace (dwallace@delanet.com)

Converts Brace-blocked Python into normal indented Python.
Brace-blocked Python is non-indentation aware and blocks are
delimited by ':{' and '}' pairs.

Thus:
    for x in range(10) :{
        if x%2 :{ print x } else :{ print z }
    }

Becomes (roughly, barring some spurious newlines):
    for x in range(10) :
        if x%2 :
            print x
        else :
            print z

This implementation is fed a line at a time via parseLine(),
outputs to a PSPServletWriter, and tracks the current quotation
and block levels internally.

src/w/e/Webware-for-Python-1.1.1/PSP/Generators.py   Webware-for-Python(Download)
import os
 
import PSPUtils, BraceConverter
 
# This is global so that the ParseEventHandler and this module agree: