Commit 9920f7b4 by BellCodeEditor

auto save

parent 5eb0ba1d
mm.png

100 KB

import wordcloud
from PIL import Image
import numpy
with open("python二级考试大纲.txt",encoding="utf-8")as f:
text = f.read()
tupian=Image.open("音乐家2.png")
data=numpy.array(tupian)
tupianyanse=wordcloud.ImageColorGenerator(data)
w=wordcloud.WordCloud(background_color="white",font_path="SimHei.ttf",mask=data,color_func=tupianyanse)
w.generate(text)
w.to_file("mm.png")
......
from PIL import Image
import numpy
img=
\ 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