from ConfigParser import ConfigParser import os cp = ConfigParser() cp.read(["/etc/brathuhn/config.cfg","brathuhn.cfg",os.path.expanduser('~/.brathuhn.cfg')]) NAME = cp.get("Account","NAME") SRV = cp.get("Account","SRV") PWD = cp.get("Account","PWD") try: RESOURCE = cp.get("Account","RESOURCE") except: RESOURCE = 'bot' try: S5B_PROXY = cp.get("General","RESOURCE") except: S5B_PROXY = 'proxy.jabbim.cz' ROOM = cp.get("Conference","ROOM") PWD_ROOM = cp.get("Conference","PWD_ROOM") print NAME,SRV