Next / Previous / Contents / TCC Help System / NM Tech homepage

2. Overview

This module uses the techniques of XML generation described in Python XML processing with lxml.

Here's the general procedure for generating a TCC-like web page:

  1. Import the tccpage2.py module as:

    import tccpage2 as tp
    

  2. Create a TCCPage instance and supply it with the desired navigational links. For the constructor and other interfaces to the tccpage2.py class, see Section 8, “class TCCPage: The page instance interface”.

  3. If the title is not a simple string—for example, if it contains markup such as filename or code tags—the content can be added to the .headTitle and/or .bodyTitle elements.

  4. Add the page's content to the .content attribute.

  5. Use the .write() method to send the finished page to its destination.

    Note that this module is intended for CGI scripting as well as for the generation of static pages. For a CGI script, simply send the output to the standard output stream, sys.stdout.