【发布时间】:2016-08-01 22:38:03
【问题描述】:
我正在处理 YAML 文件,但我一直在使用“|”对于文字引号。
我正在使用 PyYAML。
这里的主要问题是它适用于以下代码中的第一级“字典”键,但对于第二级“笔记”键它不起作用。
我尝试过使用 ">" "|+" "|-" 但没有任何效果。
Description: |
This is a sample text showing that it works fine here.
Signatures:
- {
returnValue: 'placeholder',
notes: |
Its not working here
}
- {
returnValue: 'another placeholder',
notes: '
This is working here
'
}
我检查了 http://yaml-online-parser.appspot.com/ , https://nodeca.github.io/js-yaml/ 和其他的语法,我得到了错误
错误: 在扫描下一个令牌时 找到字符“|”无法启动任何令牌 在“”,第 8 行,第 24 列: 注意:|
我浏览了In YAML, how do I break a string over multiple lines? 和其他几个线程,但没有任何效果。
【问题讨论】:
标签: yaml python-3.4 pyyaml