Commit 9eefd608 by BellCodeEditor

auto save

parent 38b5e349
Showing with 5 additions and 2 deletions
import wordcloud
from PIL import Image
# 读取文本
with open('python二级考试大纲.txt',encoding='utf-8') as f:
with open('python二级考试大纲.txt' , encoding='utf-8') as f:
text = f.read()
img =
# 创建词云对象
w = wordcloud.wordcloud(background_color="white",font_path='simHei.ttf')
w = wordcloud.wordcloud(background_color="white",font_path='SimHei.ttf')
#传入词云文本内容
w.generate(text)
#保存为png图片
......
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