用Python的Wordcloud库生成的词云图片文件找不到,程序运行也没有错误
#GovRptWordCloudV1.poy
import jieba
import wordcloud
f = open("2021年政府工作报告.txt","r", encoding="utf-8")
t = f.read()
f.close()
ls = jieba.lcut(t)
txt = " ".join(ls)
w = wordcloud.WordCloud(font_path = "msyh.ttc",width = 1000, height = 700,background_color = "white")
w.generate(txt)
再调用下 w.to_file('xx.jpg') 之类的就行吧