Feb-24-2020, 07:20 PM
Hello, I have some problem with my program. I have try to solve my problem by myself but I do something wrong. Here my yaml file.
role.one.name: werewolf role.one.desc: you are a werewolf. role.two.name: villager role.two.desc: you are a villager.And this is my python code.
import yaml with open(r'/myyamlfile') as file: role=yaml.load(file, Loader=yaml.FullLoader) #selecting the role randomly yourrole=role.one.get("name") avatarname.set("role", yourrole)But I get this error
Error:yourrole=role.one.get("name")
AttributeError: 'dict' object has no attribute 'one'
I try many thing, like switch the number into letter ( like in this exemple). I don't know what I doing wrong. thank you for your reply.