Skip to content

Instantly share code, notes, and snippets.

@justinturpin
Last active September 10, 2015 00:01
Show Gist options
  • Save justinturpin/1d8824a8e6dca6baa9ca to your computer and use it in GitHub Desktop.
Save justinturpin/1d8824a8e6dca6baa9ca to your computer and use it in GitHub Desktop.
Python Config Class
from ConfigParser import ConfigParser
class Config:
def __init__(self, paths):
self._config_parser = ConfigParser()
loaded_configs = self._config_parser.read(paths)
def __getattr__(self, k):
return self._config_parser.get("default", k)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment