Commit 943bf9ce by BellCodeEditor

auto save

parent 6fee5b55
Showing with 17 additions and 0 deletions
import jieba
result = jieba.lcut('他来自北京大学,大学')
print(result)
\ No newline at end of file
import wordcloud
from PIL import Image
with open('python二级考试大纲.txt', encoding='utf-8') as f:
my_text = f.read()
my_wordcloud = wordcloud.WordCloud(font_path='SimHei.ttf', background_color='white')
# my_wordcloud.generate('我 爱 编程 哈 什么 到底 好好学习 天天向上')
my_wordcloud.generate(my_text)
my_wordcloud.to_file('new.png')
my_image = Image.open('new.png')
my_image.show()
\ No newline at end of file
new.png

75.4 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