diff --git a/huizhi.py b/huizhi.py new file mode 100644 index 0000000..2637126 --- /dev/null +++ b/huizhi.py @@ -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') \ No newline at end of file