【发布时间】:2011-08-18 14:49:44
【问题描述】:
我正在编写一个包含一些配置数据的 YAML 文件。它将作为字典的字典读入 Python。一些数据需要在不同的键下重复。有没有办法在不进行大量剪切和粘贴的情况下做到这一点?
以下是 yaml 文件的示例:
BLOCK1:
a: 1
b: 2
c: 3
BLOCK2:
a: 4
b: 5
c: 6
BLOCK3: # Basically the same as BLOCK2
a: 4 # Is there a way to make this a link to BLOCK2 or a copy of BLOCK2?
b: 5
c: 6
【问题讨论】:
标签: yaml