root/cly/trunk/doc/tutorial/tutorial2.py

Revision 529, 153 bytes (checked in by athomas, 6 months ago)

cly: Update tutorial to reflect 1.0 API changes.

Line 
1 import sys
2 from cly import *
3
4 def do_quit():
5     sys.exit(0)
6
7 grammar = XMLGrammar('tutorial2.xml')
8 interact(grammar, user_context={'do_quit': do_quit})
Note: See TracBrowser for help on using the browser.