import yaml f=open("demo.yaml") #打开yaml文件 obj = yaml.load(f,yaml.FullLoader) # 读取并打印yaml文件信息 print(obj) f.close()