from wordcloud import WordCloud import jieba with open(r'd:\\wh.txt','r')as file: word = file.read() words=jieba.lcut(word) newtxt="".join(words) wordcloud = WordCloud(font_path="C:\Windows\Fonts\simhei.ttf", background_color="#FFFFFF", height=700, width=600, repeat=True).generate(newtxt) wordcloud.to_file("c:\\wh002.png")
词云从文件中生成
最新推荐文章于 2024-07-05 21:32:30 发布