Last active
March 14, 2019 16:25
-
-
Save benwei/9b26bf6ed485a4ff2b1835b1a478c6e4 to your computer and use it in GitHub Desktop.
test to load yaml syntax by pyyaml library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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