物理の駅 Physics station by 現役研究者

テクノロジーは共有されてこそ栄える

2020-02-01から1日間の記事一覧

Python YAML形式でKeyでソートさせない

qiita.com import yaml from collections import OrderedDict def represent_odict(dumper, instance): return dumper.represent_mapping('tag:yaml.org,2002:map', instance.items()) yaml.add_representer(OrderedDict, represent_odict) obj = OrderedDic…