Time for action - adding basic configuration read support

In this example, we'll add some basic configuration file support into our ever-growing log-processing application. There are a few values that we've been passing on the command line that have become somewhat repetitive. Let's fix that.

  1. First, create logscan-h.py, using logscan-g.py as your starting place.
  2. Update the import statements at the top of the file to look like this:
    import time
    import string
    import sys
    from optparse import OptionParser
    from collections import defaultdict
    from ConfigParser import SafeConfigParser
    from ConfigParser import ParsingError
    
  3. Now, directly below the MaxSizeHandler class, add the following configuration parser function. Note that this is not a part of the ...

Get Python 2.6 Text Processing Beginner's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.