Preserve new lines in YAML

后端 未结 2 1284
名媛妹妹
名媛妹妹 2021-01-07 18:45

How do I format a YAML document like this so that PyYAML can parse it properly?

Data: Some data, here and a special character like \':\'
      Another line o         


        
2条回答
  •  北海茫月
    2021-01-07 19:40

    If the extra newline that NullUserException's solutions is adding is a problem you should be using:

    Data: |-
          Some data, here and a special character like ':'
          Another line of data on a separate line
    

提交回复
热议问题