Commit 297077a2 by BellCodeEditor

save project

parent 4b52e743
Showing with 3 additions and 2 deletions

80.6 KB | W: | H:

218 KB | W: | H:

j.png
j.png
j.png
j.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -7,7 +7,7 @@ with open("python二级考试大纲.txt","r",encoding="utf-8")as f: ...@@ -7,7 +7,7 @@ with open("python二级考试大纲.txt","r",encoding="utf-8")as f:
img=Image.open("bell.png") img=Image.open("bell.png")
data=numpy.array(img) data=numpy.array(img)
img_color=wordcloud.ImageColorGenerator(data) img_color=wordcloud.ImageColorGenerator(data)
w=wordcloud.WordCloud(background_color="blue",font_path="SimHei.ttf" w=wordcloud.WordCloud(background_color="blue",font_path="SimHei.ttf",mask=data,color_func=img_color)
mask=data,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