blob: 59e8992ddd7257995ac02a8a22abe01a3c6687bf (
plain)
1
2
3
4
5
6
7
8
9
10
|
import yaml
from pathlib import Path
def load_yml(file: Path, encoding='utf-8') -> dict:
"""加载 yml 文件"""
with open(file, 'r', encoding=encoding) as f:
data = yaml.safe_load(f)
return data
|