blob: 7a2f655af311a3c3845142c7b28144daf500b553 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/usr/bin/python
from __future__ import absolute_import, print_function, unicode_literals
import yaml
inobj = {
"date": "2001-01-23",
"state": "MI",
"quantity": 4
}
print("type inobj = %s" % type(inobj))
print(inobj)
res = yaml.dump(inobj, encoding="utf-8", default_flow_style=False,
default_style=False, canonical=False, Dumper=yaml.SafeDumper)
print("'%s'" % res)
|