parent
d542128f5d
commit
328e7cd338
@ -0,0 +1,8 @@
|
||||
from imageio.v2 import imread
|
||||
import wordcloud
|
||||
|
||||
#绘制词云图
|
||||
txt = open('C:\\Users\\86158\\爬虫作业\\ciyuntu.txt','r',encoding='utf-8').read()
|
||||
w = wordcloud.WordCloud(background_color='white',font_path='c:\\WINDOWS\\Fonts\\simkai.TTF',mask=imread(r'C:\\Users\\86158\\Pictures\\R-C.jpg'))
|
||||
w.generate(txt)
|
||||
w.to_file('C:\\Users\\86158\\爬虫作业\\ciyuntu3.png')
|
Loading…
Reference in new issue