Created
August 6, 2013 08:55
-
-
Save vanzaj/6162860 to your computer and use it in GitHub Desktop.
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: | |
- 0.5 | |
- one | |
- True | |
c: | |
key: 3 | |
another key: [4, 'five'] | |
name: This is a rather long description | |
that can span multiple lines | |
description: | # note the pipe | |
A 'literal' text | |
where line breaks are preserved | |
""" | |
doc = yaml.load(document) | |
doc['c']['another key'] | |
print yaml.dump(doc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment