Commit f95475c6 by BellCodeEditor

auto save

parent 0bd66945
Showing with 11 additions and 6 deletions

232 KB | W: | H:

259 KB | W: | H:

1.png
1.png
1.png
1.png
  • 2-up
  • Swipe
  • Onion skin
import wordcloud import wordcloud
from PIL import Image from PIL import Image
import numpy import numpy
import jieba
img=Image.open("bell.png") img=Image.open("bell.png")
data=numpy.array(img) data=numpy.array(img)
img_colors=wordcloud.ImageColorGenerator(data) img_colors=wordcloud.ImageColorGenerator(data)
w=wordcloud.WordCloud(background_color=(0,0,0), w=wordcloud.WordCloud(background_color=(0,0,0),
font_path='SIMKAI.TTF', font_path='SIMKAI.TTF',
mask=data,color_func=img_colors) mask=data,color_func=img_colors)
f=open("python二级考试大纲.txt","r",encoding="utf-8") # stopwords=stopwords,max_font_size=60)
t123=f.read() f=open("C:\\Users\EDY\\Documents\\level3-lesson21-diy3\\python二级考试大纲.txt","r",encoding="utf-8")
w=w.generate(t123) t1=f.read()
text_a=jieba.lcut(t1)
w=w.generate(t1)
w=w.to_file("1.png") w=w.to_file("1.png")
f.close() f.close()
\ No newline at end of file # text_a=jieba.lcut(t123)
# print(text_a)
\ 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