blob: 046d692ebe16430de80be5c0cb7e6085ea10981e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
from __future__ import print_function
import ruamel.yaml
inp = """\
# example
name:
# details
family: Smith # very common
given: Alice # one of the siblings
"""
code = ruamel.yaml.load(inp, ruamel.yaml.RoundTripLoader)
code['name']['given'] = 'Bob'
print(ruamel.yaml.dump(code, Dumper=ruamel.yaml.RoundTripDumper), end='')
|