20
如何格式化這樣的YAML文檔,以便PyYAML能夠正確解析它?在YAML中保留新行
Data: Some data, here and a special character like ':'
Another line of data on a separate line
我知道「:」字符是特殊的,所以我必須圍繞整個事情的報價像這樣:
Data: "Some data, here and a special character like ':'
Another line of data on a separate line"
而且爲了添加一個新行,我要補充「\ n」的
Data: "Some data, here and a special character like ':'\n
Another line of data on a separate line"
反正是有格式文件YAML,所以我不必爲了有一個新行添加'\n
的?