yaml code:
name: "something"
posessions:
- bar
- Towel
- Foo
python code:
from strictyaml import load, Map, Str, Int, Seq, YAMLError
with open("my-data.yaml", "r") as stream:
try:
data = load(stream)
print(data)
except YAMLError as error:
print(error)
Executing this code incorrectly prints an error about the colon:
File "data.yaml", line 2
posessions:
^
SyntaxError: invalid syntax
yaml code:
python code:
Executing this code incorrectly prints an error about the colon:
File "data.yaml", line 2 posessions: ^ SyntaxError: invalid syntax