gcd宣言wordcloud

代码

import wordcloud
import jieba

f=open("gcd宣言.txt","r",encoding="utf-8")
t=f.read()
f.close()
txt=" ".join(jieba.lcut(t))
w=wordcloud.WordCloud(font_path="msyh.ttc",width=1000,height=700,max_words=15)
w.generate(txt)
w.to_file(" gcd宣言.png")

图片效果

原文地址:https://www.cnblogs.com/3072952697whl/p/12663463.html