"""
yaml
"""

import yaml

# write
with open('config.yaml', 'w') as yaml_file:
    yaml.dump({
        'web_server': {
            'host': '127.0.0.1',
            'port': 80
        },
        'db_server': {
            'host': '127.0.0.1',
            'port': 3306
        }
    }, yaml_file, default_flow_style=False)

# read
with open('config.yaml', 'r') as yaml_file:
    config = yaml.safe_load(yaml_file)
    print(config)