The following code:
from ruamel.yaml import YAML
import sys, textwrap
yaml = YAML()
yaml.default_flow_style = False
yaml.dump({
'hello.py': textwrap.dedent("""
import sys
sys.stdout.write("hello world")
""")
}, sys.stdout)
produces:
hello.py: "import sys
sys.stdout.write("hello world")
"
is there a way to make it produce:
hello.py: |
import sys
sys.stdout.write("hello world")
instead?
Versions:
python: 2.7.16 on Win10 (1903)
ruamel.ordereddict==0.4.14
ruamel.yaml==0.16.0
ruamel.yaml.clib==0.1.0
See Question&Answers more detail:os