赞
踩
from wordcloud import WordCloud import jieba with open(r'd:\\wh.txt','r')as file: word = file.read() words=jieba.lcut(word) newtxt="".join(words) wordcloud = WordCloud(font_path="C:\Windows\Fonts\simhei.ttf", background_color="#FFFFFF", height=700, width=600, repeat=True).generate(newtxt) wordcloud.to_file("c:\\wh002.png")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。