File size: 300 Bytes
b8a2bdc
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from pathlib import Path
import yaml

def load_config(path='config.yaml'):
    p = Path(path)
    if not p.exists():
        raise FileNotFoundError(f"Missing config file: {path}")
    return yaml.safe_load(p.read_text())

def save_text(path, text):
    Path(path).write_text(text, encoding='utf-8')