From: karim hamidou Date: Thu, 12 Jul 2012 07:46:54 +0000 (+0200) Subject: added a file to handle a config file. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=6ef15cc619a8f931d747f00bd3315b00874f15b6;p=cagibi.git added a file to handle a config file. --- diff --git a/cagibi/config.py b/cagibi/config.py new file mode 100644 index 0000000..d4ac402 --- /dev/null +++ b/cagibi/config.py @@ -0,0 +1,9 @@ +import json + +def load_config(filename="config.json"): + """load a configuration file in json""" + return json.load(open(filename)) + +def save_config(config, filename="config.json"): + """save a configuration file""" + json.dump(config, open(filename, 'w'))