我使用 PyYAML 读取文件,python 代码为:
with open('demo.yml') as f:
dataMap = yaml.load(f)
演示.yml:
%YAML:1.0
my_svm: !!opencv-ml-svm
svm_type: C_SVC
kernel: { type:LINEAR }
C: 1.
那么错误是:
yaml.scanner.ScannerError: while scanning a directive
in "demo.yml", line 1, column 1
expected alphabetic or numeric character, but found ':'
in "demo.yml", line 1, column 6
谁来帮帮我?