Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python3
import yaml
from pprint import pprint
yaml_code = """
Example:
name: "Example"
timestamp: 1500421023
nested:
- name: "Part 1"
content: "Stuff"
- name: "Part 2"
content: "Things"
- name: "Part 3"
content: "More Stuff"
meta:
count: 64
color:
red: 234
green: 138
blue: 4
"""
def main():
decoded = yaml.load(yaml_code)
pprint(decoded)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.