Commit 90064e3a by BellCodeEditor

save project

parent 6a3677a3
Showing with 7 additions and 3 deletions
import wordcloud
w=wordcloud.WordCloud(background_color='white',font_path='SimHei.ttf',width=1920,height=1080)
from PIL import Image
import numpy as np
img=Image.open('bell.png')
data=np.array(img)
w=wordcloud.WordCloud(background_color='white',font_path='SimHei.ttf',width=1920,height=1080,mask=data,color_func=wordcloud.ImageColorGenerator(data))
with open('python二级考试大纲.txt','r',encoding='utf-8') as z:
txt=z.read()
w.generate(txt)
w.to_file('pic.png')
\ No newline at end of file
w.to_file('pic1.png')
\ No newline at end of file

742 KB | W: | H:

191 KB | W: | H:

pic.png
pic.png
pic.png
pic.png
  • 2-up
  • Swipe
  • Onion skin
pic1.png

184 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