Update 源码.py

master
prgofbca7 3 years ago
parent 4248ec6bd5
commit 4678464e4a

@ -87,7 +87,7 @@ def Gnerate_wordcloud(path)->None:
通过wordcloud库以及jieba将对应的文本文件生成词云 通过wordcloud库以及jieba将对应的文本文件生成词云
并且能够将所生成词云弹出 并且能够将所生成词云弹出
''' '''
mas = np.array(Image.open("D:\\pytest\\xt\\qs.png"))#读取背景图的信息 #mas = np.array(Image.open("D:\\pytest\\xt\\qs.png"))#读取背景图的信息
fp= open(path, 'r', encoding='utf-8')#获取文件指针 fp= open(path, 'r', encoding='utf-8')#获取文件指针
s=fp.read()#读取文件信息 s=fp.read()#读取文件信息
fp.close() fp.close()
@ -96,7 +96,7 @@ def Gnerate_wordcloud(path)->None:
w=wordcloud.WordCloud(font_path="msyhbd.ttc", w=wordcloud.WordCloud(font_path="msyhbd.ttc",
width=2000, width=2000,
height=1700, height=1700,
mask=mas, #mask=mas,
background_color="white" background_color="white"
)#初始化 )#初始化
w.generate(tx)#生成词云 w.generate(tx)#生成词云

Loading…
Cancel
Save