diff --git a/词云.py b/词云.py deleted file mode 100644 index 906b4d4..0000000 --- a/词云.py +++ /dev/null @@ -1,22 +0,0 @@ -# 导入结巴分词模块 -import jieba -# 导入词云图 -import wordcloud - -# 读取文件内容 -f = open('弹幕.txt', encoding='utf-8') -txt = f.read() -print(txt) -string = ''.join(jieba.lcut(txt)) -print(string) -# 设置词云图格式 -wc = wordcloud.WordCloud( - width=1000, - height=1000, - background_color='white', - # 指定文字 - font_path='msyh.ttc', - scale=15, -) -wc.generate(string) # 生成 -wc.to_file('弹幕词云.png')