xref: /OK3568_Linux_fs/buildroot/support/testing/tests/package/sample_python_pyyaml_enc.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1import yaml
2
3data = {
4    "name": "python-pyyaml",
5    "versions": ["1", "2"],
6    "group": {
7        "is_a_package": True,
8        "value": 42
9    }
10}
11serialized = yaml.dump(data, default_flow_style=False)
12print(serialized)
13with open("/tmp/data.yml", "w") as f:
14    f.write(serialized)
15