Szymon Lipiński Szymon Lipiński - 1 year ago 101
Python Question

How can I parse a YAML file in Python

How can I parse a YAML file in Python?

Jon Jon
Answer Source

The easiest and pureist method without relying on C headers is PyYaml:

#!/usr/bin/env python

import yaml

with open("example.yaml", 'r') as stream:
    except yaml.YAMLError as exc:

Err.. that's it... how many lines of code would that take me in Java... any ideas? : ) more info here:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download