def read(path="config.edata"): r = {} fd = open(path,"r").read() fd = fd.split("\n") for x in fd: k,v = x.split(":",1) r[k] = v return r def save(r,path="config.edata"): fd = "" for k in r: fd += k+":"+str(r[k]) open(path,"w").write(fd) if __name__ == "__main__": p = raw_input("edata file path: ") ed = read(p) for k in ed: print(k+":"+ed[k]) raw_input("Press [ENTER] to exit...")