Skip to content

Instantly share code, notes, and snippets.

@benwei
Last active March 14, 2019 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benwei/9b26bf6ed485a4ff2b1835b1a478c6e4 to your computer and use it in GitHub Desktop.
Save benwei/9b26bf6ed485a4ff2b1835b1a478c6e4 to your computer and use it in GitHub Desktop.
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