Python Dump YAML Using Double Quotes Around Strings
问题 In Python 3.5, I have the following dictionary to be dumped into a .yaml file. D={'name': 'mydata', value: {'x': 1, 'y': 2, 'z':3}} When I run the following code: import ruamel import ruamel.yaml as yaml D={'name': 'mydata', 'value': {'x': 1, 'y': 2, 'z':3}} yaml.round_trip_dump(D, open('my_yaml.yaml', 'w'), default_flow_style=False, indent=4) The resulting my_yaml.yaml looks like the following: name: mydata value: z: 3 x: 1 y: 2 My question is, is there a handy way to write double quotes