[code.view]

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

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2010 Doug Hellmann.  All rights reserved.
     #
     """Reading a configuration file.
     """
     #end_pymotw_header
     
     from ConfigParser import SafeConfigParser
     
     parser = SafeConfigParser()
     parser.read('interpolation_defaults.ini')
     
     print 'URL:', parser.get('bug_tracker', 'url')
     

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

contact | logmethods.com