wikiteam
wikiteam copied to clipboard
Save config with ConfigParser instead of cPickle
We use cPickle for saving/loading the config. But ConfigParser keeps it easy to edit in a more human-readable format.
Module doc: https://docs.python.org/2/library/configparser.html
What is the advantage of ConfigParser over JSON?
Readability?
cPickle is unreadable to me, but is ConfigParser really more readable than formatted JSON? I think a lot of custom parsing code would need to be added for ConfigParser, e.g. to divide it up into sections and implement comma, pipe, or space delimited lists (ConfigParser has no built-in list support).
ConfigParser has built-in support for sections. Lists would probably have to be implemented independently.