def getlist(option, sep=',', chars=None): """Return a list from a ConfigParser option. By default, split on a comma and strip whitespaces.""" return [ chunk.strip(chars) for chunk in option.split(sep) ]