Skip to content

Instantly share code, notes, and snippets.

@dreikanter
Created May 24, 2012 10:58
Show Gist options
  • Save dreikanter/2780824 to your computer and use it in GitHub Desktop.
Save dreikanter/2780824 to your computer and use it in GitHub Desktop.
Dynamic #configuration file inclusion demo
# Dynamic configuration file inclusion example.
# This script is intended for demo purposes and home usage only.
# There are intentionally no any security checks.
import imp
import sys
if len(sys.argv) < 2:
print "Specify a configuration file to include"
exit(1)
print "Including [%s]" % sys.argv[1]
conf = imp.load_source('conf', sys.argv[1])
print conf.param
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment