我可以使用如下列表读取配置文件:
# config file is called config.txt
[PARAMETER]
site_loc = [45.77,-87.20]
# Read in site_loc list
import ast
from ConfigParser import SafeConfigParser
# Parse config file
parser = SafeConfigParser()
parser.read('config.txt')
有没有办法阅读清单?例如site_loc = [[45.77,-87.20], [23.0,-45.0]]
答案 0 :(得分:1)