Created
          March 21, 2012 23:42 
        
      - 
      
- 
        Save pydanny/2154218 to your computer and use it in GitHub Desktop. 
    Sample configparser usage
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # python file | |
| import ConfigParser | |
| config = ConfigParser.ConfigParser() | |
| config.read('settings.cfg') | |
| API_KEY = config.get('Params', 'api_key') | |
| BASE_URL = config.get("Params", 'base_url') | |
| # settings.cfg | |
| [Params] | |
| api_key=72c9f72f2ea75b97c0d5b7117344c6a6 | |
| base_url=http://consumernotebook.com/api/v1/ | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment