From 003338c636ce7d5dad45f456c76d687c80e41b15 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 4 Jul 2021 19:57:41 +0800 Subject: [PATCH] save project --- my_cloud.py | 6 +----- pic1.png | Bin 212830 -> 0 bytes 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/my_cloud.py b/my_cloud.py index 65f7415..cdec8c8 100644 --- a/my_cloud.py +++ b/my_cloud.py @@ -1,14 +1,10 @@ import wordcloud from PIL import Image import numpy as np -import jieba img=Image.open('bell.png') data=np.array(img) -stopword=['的','python','和'] +w=wordcloud.WordCloud(background_color='white',font_path='SimHei.ttf',width=1920,height=1080,mask=data,color_func=wordcloud.ImageColorGenerator(data)) with open('python二级考试大纲.txt','r',encoding='utf-8') as z: txt=z.read() -jbtxt=jieba.lcut(txt) -text= " ".join(jbtxt) -w=wordcloud.WordCloud(background_color='white',font_path='SimHei.ttf',width=1920,height=1080,mask=data,color_func=wordcloud.ImageColorGenerator(data),stopwords=stopword,max_font_size=60) w.generate(txt) w.to_file('pic1.png') \ No newline at end of file diff --git a/pic1.png b/pic1.png index 62a3166..88872ea 100644 Binary files a/pic1.png and b/pic1.png differ -- libgit2 0.25.0