Created
July 18, 2017 23:54
-
-
Save auxiliary-character/fd8993d5144424f47289678fee8e2ef9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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