class Read_data_class:
def read_yml_def(self, dir_path):
with open(dir_path, 'r', encoding='utf-8') as f:
yaml_list = yaml.safe_load(f)
return yaml_list
if name == 'main':
pass
class main():
path = os.path.join(os.path.dirname(file), '文件.yml')
data_yml = read_yml_data.Read_data_class().read_yml_def(path)