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

3. Program source

This section describes the actual code of the homelist.py script, in literate programming style. For a definition of literate programming, as well as the tool used to extract the code from the document source, see A source extractor for lightweight literate programming.

3.1.  The prologue

Since Python scripts have the main at the end, you may wish to jump right to Section 3.10, “ The main program ”.

The script starts out with a line to make it self-executing according to the usual Unix conventions. Next comes a brief comment pointing back to this document.

homelist.py
#!/usr/local/bin/python
#================================================================
# homelist.py:  Generate a list of user homepages.
#   For documentation, see:
#     http://www.nmt.edu/tcc/projects/homelist/

Next we document the overall intended function of the script. For more information on intended functions and the Cleanroom programming methodology, see the author's Cleanroom pages.

homelist.py
#----------------------------------------------------------------
# Overall intended function:
#   [ sys.stdout  +:=  an XHTML table containing a list of user
#       names and homepage links for all users in the TCC's LDAP
#       server who have a homepage ]
#----------------------------------------------------------------