Getting a list from a config file with ConfigParser
问题 I have something like this in my config file (a config option that contains a list of strings): [filters] filtersToCheck = ['foo', '192.168.1.2', 'barbaz'] Is there a more elegant (built-in) way to get a list from filtersToCheck instead of removing the brackets, single-quotes, spaces and then using split() to do that? Maybe a different module? (Using python3.) 回答1: You cannot use the python object like a list in the value for the config file. But you can ofcourse have them as comma separated