Commit c3db250b by BellCodeEditor

save project

parent 8ead4ffa
Showing with 4 additions and 3 deletions
...@@ -7,10 +7,10 @@ with open('python二级考试大纲.txt',encoding="utf-8") as f: ...@@ -7,10 +7,10 @@ with open('python二级考试大纲.txt',encoding="utf-8") as f:
text=f.read() text=f.read()
a=jieba.lcut(text) a=jieba.lcut(text)
b=" ".join(a) b=" ".join(a)
img=image.open('bell.png') img=Image.open('bell.png')
data=numpy.array(img) data=numpy.array(img)
stopwords=["的","python","和","基本","程序"] stopwords=["的","python","和","基本","程序"]
imgcolor=wordcloud.ImageColorGenerator(date) imgcolor=wordcloud.ImageColorGenerator(data)
wordcloud.wordCloud(background_color="black",font_path="SimHef.ttf",mask=data,color_func=imgcolor,stopwords=stopwords,max_font_size=60) w=wordcloud.WordCloud(background_color="black",font_path="SimHef.ttf",mask=data,color_func=imgcolor,stopwords=stopwords,max_font_size=60)
w.generate(b) w.generate(b)
w.to_fill('wycloud.png') w.to_fill('wycloud.png')
\ No newline at end of file
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