def yaml_to_python():

    some_string = """
name: Glen Jarvis
sex: Male
title: Senior Developer
hp: [32, 71]
sp: [1, 13]
gold: 423
inventory:
  - A laptop
  - Some code
  - A lot of hope
"""

    some_python = yaml.load(some_string)

    print "YAML -> Python Example"
    print "type(some_string): {0}".format(type(some_string))
    print "type(some_python): {0}".format(type(some_python))

    print "\n\nYAML (really string in Python):"
    pprint.pprint(some_string)
    print "\n\nPython:"
    pprint.pprint(some_python)
Demonstrate YAML string parsed to Python
dataset/ETHPy150Open glenjarvis/ansible_tutorial/src/playbook_examples/data_types_yaml_example.py/yaml_to_python