代码拉取完成,页面将自动刷新
from itertools import combinations
import yaml
import pathlib
import sys
def read_config(path):
with open(path) as f1:
return yaml.load(f1)
def write_config(config, path):
with open(path, "w") as f1:
yaml.dump(config, f1)
def enumerate_configs(original_path, out_path):
#colors = ['blue','red','green','yellow','gray','orange','purple','brown']
colors = ['blue','red','green', 'yellow']
combos = combinations(colors,2)
original_config = read_config(original_path)
for combo in combos:
original_config['color_pair'] = ",".join(combo)
write_config(original_config, out_path.joinpath("".join(combo) + ".yaml"))
if __name__ == "__main__":
original_config = sys.argv[1]
out_path = sys.argv[2]
enumerate_configs(pathlib.Path(original_config), pathlib.Path(out_path) )
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。