13 lines
269 B
Python
13 lines
269 B
Python
|
|
# -*- coding: utf-8 -*-
|
||
|
|
import yaml
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
|
||
|
|
def read_config(path):
|
||
|
|
if Path(path).exists():
|
||
|
|
with open(path, encoding="utf-8") as f:
|
||
|
|
config = yaml.safe_load(f)
|
||
|
|
return config
|
||
|
|
else:
|
||
|
|
raise FileNotFoundError
|