Commit f40c7234 by BellCodeEditor

save project

parent 6dfeec30
Showing with 8 additions and 1 deletions
import wordcloud
from PIL import Image
import numpy
with open("python二级考试大纲.txt","r",encoding="utf-8") as f:
d=f.read()
w=wordcloud.WordCloud(background_color="red",font_path="SimHei.ttf")
b=Image.open("bell.png")
c=numpy.array(b)
img_colors=wordcloud.ImageColorGenerator(c)
w=wordcloud.WordCloud(background_color="red",font_path="SimHei.ttf",mask=c,color_func=img_colors)
w.generate(d)
w.to_file("word.png")
\ No newline at end of file

80 KB | W: | H:

219 KB | W: | H:

word.png
word.png
word.png
word.png
  • 2-up
  • Swipe
  • Onion skin
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