From 6ef15cc619a8f931d747f00bd3315b00874f15b6 Mon Sep 17 00:00:00 2001 From: karim hamidou Date: Thu, 12 Jul 2012 09:46:54 +0200 Subject: [PATCH] added a file to handle a config file. --- cagibi/config.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 cagibi/config.py 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')) -- 2.43.0