Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Using Python as the config language for a Python program
  2. account_config = __import__(settings.CONFIG_DIR + '.account_name', fromlist=[settings.CONFIG_DIR])
  3.        
  4. CONFIG = "some string"
  5. ANOTHER = [ "some", "list" ]
  6. MORE = "another value"
  7.        
  8. settings = {}
  9. execfile('the_config.py', settings )
  10. settings['CONFIG'] == "some string"