Skip to content

Instantly share code, notes, and snippets.

@phobologic
Created June 25, 2013 23:21
Show Gist options
  • Save phobologic/5863373 to your computer and use it in GitHub Desktop.
Save phobologic/5863373 to your computer and use it in GitHub Desktop.
import imp
import os
config_path = os.environ.get('CONFIG_FILE', '/etc/blah')
path, module = os.path.split(config_path)
module_info = imp.find_module(module, [path])
settings = imp.load_module('settings', *module_info)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment