# os: Use bash environment variables import os # ConfigParser: Use variables from external file import ConfigParser # New ConfigParser instance called "config" config = ConfigParser.ConfigParser() # Read the Config File config.read(os.environ.get('HOME') + "/.settings/config") # Set variables based off of the config file read my_color1 = config.get("colors", "color1") my_color2 = config.get("colors", "color2") # Show gathered settings print("My colors were: %s and %s") % (my_color1, my_color2)