In addition to importing your .py template module file into a Python script or using it as a Webware servlet, you can also run it from the command line as a standalone program. The program will print the filled template on standard output. This is useful while debugging the template, and for producing formatted output in shell scripts.
When running the template as a program, you cannot provide a searchList or
self. attributes in the normal way, so you must take
alternative measures to ensure that every placeholder has a value.
Otherwise, you will get the usual
NameMapper.NotFound exception at
the first missing value. You can either set default values in the template
itself (via the
#def directives) or in a Python
superclass, or use the
--pickle command-line options,
which work just like their ``cheetah fill'' counterparts.
python FILENAME.py --help to see all the command-line
options your .py template module accepts.