Commit ffd4657f by BellCodeEditor

save project

parent 43f4c1b5
Showing with 8 additions and 2 deletions
import wordcloud import wordcloud
from PIL import Image
import numpy
with open("python二级考试大纲.txt","r"encoding="utf-8")as f: with open("python二级考试大纲.txt","r"encoding="utf-8")as f:
a = f.read() a = f.read()
img = Image.open("bell.png")
w = wordcloud.WordCloud(background_color="red",font_path="simHel.ttf") img_color = wordcloud.ImageColorGenerator(date)
date = numpy.array(img)
w = wordcloud.WordCloud(background_color="white",font_path="simHel.ttf",
mask=date,color_func=img_color)
w.generate(a) w.generate(a)
w.to_file("j.png") w.to_file("j.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