[code.view]

[top] / python / PyMOTW / ConfigParser / ConfigParser_read.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('simple.ini')
     
     print parser.get('bug_tracker', 'url')
     
     
     
     

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

contact | logmethods.com