Skip to content

Instantly share code, notes, and snippets.

@benwei
Last active March 14, 2019 16:25
test to load yaml syntax by pyyaml library
import yaml
document = """
a: 1
b:
c: 3
d: 4
"""
r_load=yaml.dump(yaml.load(document))
print(r_load)
r_dump=yaml.dump({'name': "The Cloak 'Colluin'",
'depth': 5, 'rarity': 45,
'weight': 10,
'cost': 50000,
'flags': ['INT', 'WIS', 'SPEED', 'STEALTH']})
print(r_dump)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment