Commit 26c56a8d by BellCodeEditor

auto save

parent 5bced5d9
Showing with 5 additions and 0 deletions
import wordcloud import wordcloud
import jieba
with open("python二级考试大纲.txt",encoding="utf-8")as f: with open("python二级考试大纲.txt",encoding="utf-8")as f:
text = f.read() text = f.read()
text_list=jieba.lcut(text)
text_list="".jion(txt_list)
img=ImageColor = wordcloud.ImageColorgenerate(data)
stopwords = ["的"]
wordcloud.WordCloud(background_color="green",font_path="simhei.ttf",mask=data,color_func=imgcolor) wordcloud.WordCloud(background_color="green",font_path="simhei.ttf",mask=data,color_func=imgcolor)
w.generate(text) w.generate(text)
w.to_file("mycloud") w.to_file("mycloud")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment