Commit 9f0ad1f8 by BellCodeEditor

save project

parent 06cab0d3
Showing with 15 additions and 3 deletions
import wordcloud
from PIL import Image
import numpy as np
w = wordcloud.WordCloud(background_color="white")
with open("python二级考试大纲.txt",encoding="utf-8") as f:
text = f.read()
img
w = wordcloud.WordCloud(background_color="white"font_path="simHei.ttf")
w.generate("hello word")
w.to_file("mycloud.pog")
\ No newline at end of file
w.to_file("1.png")
img = Image.open("6x2.png")
print(img)
value = np.array(img)
print(value)
\ No newline at end of file
mycloud.png

8.48 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