import jieba
from wordcloud import WordCloud
import imageio
mask=imageio.imread('E:\python玩\词云大作业龙族\路明非.png')
f = open( "E:\python玩\词云大作业龙族\龙族.txt", "r", encoding= "utf-8")
jieba.load_userdict("E:\python玩\词云大作业龙族\特定.txt")
t = f.read()
f.close()
l =jieba.lcut(t)
txt =" ".join(l)
W = WordCloud(background_color="white",\
width=800,\
height=600,\
stopwords={'每个','就是','不是','某个','广大','而是','什么','最亲','这个','一个'}, \
max_words=200,\
max_font_size=80,\
mask=mask,\
scale=4,\
font_path='msyh.ttc').generate(txt)
W.to_file("E:\python玩\词云大作业龙族\龙族幻想.png" )