Skip to content

Instantly share code, notes, and snippets.

@vanzaj
Created August 6, 2013 08:55
Show Gist options
  • Save vanzaj/6162860 to your computer and use it in GitHub Desktop.
Save vanzaj/6162860 to your computer and use it in GitHub Desktop.
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