Commit 32f49a98 by BellCodeEditor

save project

parent 98bce895
Showing with 7 additions and 2 deletions
import wordcloud
from PIL import Image
import numpy
zhu2=Image.open("桃子.png")
import jieba
zhu2=Image.open("猪.png")
zhu3=numpy.array(zhu2)
zhu4 = wordcloud.ImageColorGenerator(zhu3)
zhu=wordcloud.WordCloud(background_color="white",font_path='SimHei.ttf',mask=zhu3,color_func=zhu4)
zhu5=["的","python","和","基本","程序"]
zhu=wordcloud.WordCloud(background_color="white",font_path='SimHei.ttf',mask=zhu3,color_func=zhu4,stopwords=zhu5,max_font_size=60)
with open('python二级考试大纲.txt','r',encoding='utf-8') as f:
zhu1=f.read()
zhu1=jieba.lcut(zhu1)
zhu1=" ".join(zhu1)
zhu.generate(zhu1)
zhu.to_file("zhuzhuzhuzhuzhuzhu.png")
\ No newline at end of file

417 KB | W: | H:

65.3 KB | W: | H:

zhuzhuzhuzhuzhuzhu.png
zhuzhuzhuzhuzhuzhu.png
zhuzhuzhuzhuzhuzhu.png
zhuzhuzhuzhuzhuzhu.png
  • 2-up
  • Swipe
  • Onion skin
猪.png

78.3 KB

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