Skip to content

Instantly share code, notes, and snippets.

@pydanny
Created March 21, 2012 23:42
Show Gist options
  • Save pydanny/2154218 to your computer and use it in GitHub Desktop.
Save pydanny/2154218 to your computer and use it in GitHub Desktop.
Sample configparser usage
# 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