1. 讀取yml文件
//獲取配置文件路徑
config_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "config.yml")
if os.path.isfile(config_file_path):
//讀取配置
with open(config_file_path, "r") as f:
config = yaml.load(f, Loader=yaml.FullLoader)
else:
config = {}