Pyyaml notes

From Federal Burro of Information
Jump to navigationJump to search


pyYaml

#!/usr/bin/env python

import yaml

with open("repo_list.txt", 'r') as stream:
    try:
        data = yaml.load(stream)
        print yaml.dump(data)
    except yaml.YAMLError as exc:
        print(exc)