Created
May 24, 2012 10:58
-
-
Save dreikanter/2780824 to your computer and use it in GitHub Desktop.
Dynamic #configuration file inclusion demo
This file contains 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
# 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