[code.view]

[top] / python / PyMOTW / ConfigParser / ConfigParser_interpolation_error.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2010 Doug Hellmann.  All rights reserved.
     #
     """Default handling.
     """
     #end_pymotw_header
     
     import ConfigParser
     
     parser = ConfigParser.SafeConfigParser()
     
     parser.add_section('bug_tracker')
     parser.set('bug_tracker', 'url', 'http://%(server)s:%(port)s/bugs')
     
     try:
         print parser.get('bug_tracker', 'url')
     except ConfigParser.InterpolationMissingOptionError, err:
         print 'ERROR:', err
     

[top] / python / PyMOTW / ConfigParser / ConfigParser_interpolation_error.py

contact | logmethods.com