Commit 782a0370 by BellCodeEditor

save project

parent 2606c59d
Showing with 7 additions and 1 deletions
File added
import wordcloud import wordcloud
import numpy as np
from PIL import Image
f=open('python二级考试大纲.txt','r',encoding='utf-8') f=open('python二级考试大纲.txt','r',encoding='utf-8')
n=f.read() n=f.read()
w=wordcloud.WordCloud(background_color='skyblue',font_path='STHUPO.TTF') i=Image.open('bell.png')
v=np.array(i)
d=wordcloud.ImageColorGenerator(v)
w=wordcloud.WordCloud(background_color='skyblue',font_path='STXINWEI.TTF',mask=v,color_func=d)
w.generate(n) w.generate(n)
w.to_file('sb.png') w.to_file('sb.png')
f.close() f.close()
\ No newline at end of file
No preview for this file type
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