current position:Home>Python writing yaml file

Python writing yaml file

2022-06-24 06:57:25CSDN Q & A

Raw data

img


expect yaml Write format

img


actual yaml Write the result

img


Write method used
with open('locationtest.yaml','w',encoding='utf-8') as f1:
yaml.dump(ab, f1, Dumper=yaml.RoundTripDumper,default_flow_style=False,allow_unicode=True, indent=4)
How can I get the yaml Format

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/175/202202150002034488.html

Random recommended