Wednesday, June 30, 2004

pyparsing -- a class library for text processing in Python: "Here is a complete 'Hello, World!' program, using the pyparsing module:
from pyparsing import Word, alphas, oneOf
greet = Word( alphas ) + ',' + Word( alphas ) + oneOf('! ? .')
hello = 'Hello, World!'
print hello, '->', greet.parseString( hello )

This program results in:
Hello, World! -> ['Hello', ',', 'World', '!']"