From 328e7cd338b9bc4184ab98ad5b989b5dd8cba7ff Mon Sep 17 00:00:00 2001 From: pkjq8ohf2 <2100488276@qq.com> Date: Tue, 17 Sep 2024 14:06:07 +0800 Subject: [PATCH] ADD file via upload --- huizhi.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 huizhi.py 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