【发布时间】:2013-05-30 17:17:05
【问题描述】:
我希望能够从配置文件部分读取文件的变量列表,并使用该列表中的键来指向为每个文件定义属性的更多部分。文件的数量、名称和属性可以更改。有没有人看到任何这样做的方法或可以指出正确的方向?
[paths]
file1=/some/path/
file2=/some/other/path
[file1]
key_specific_to_file_1=some_attribute_value
[file2]
key_specific_to_file_2=some_attribute_value2
[non-file-related-section]
some_key=some-other-value
【问题讨论】:
-
究竟是什么问题,需要做什么?
-
好问题...我认为分析过度了。我想我可以在 [paths] 部分中获取键列表。有时候真的就是这么简单……
标签: python configparser