Closed veadex closed 1 year ago
不好意思,我的问题,png格式也能使用
随机选取标题是平均概率的吗?
def get_copywriting() -> Tuple[str, str]:
'''
Read the copywriting.json, choice a luck with a random content
'''
_p: Path = fortune_config.fortune_path / "fortune" / "copywriting.json"
with open(_p, "r", encoding="utf-8") as f:
content = json.load(f).get("copywriting")
luck = random.choice(content)
title: str = luck.get("good-luck")
text: str = random.choice(luck.get("content"))
return title, text`
我看这个里面好像没有传入概率的参数
random.choice()
就是平均概率
大佬,我尝试使用png的文件格式,但是它会报错,我想问一下要改哪个代码才能对png格式的图进行绘制啊,麻烦大佬了