def __init__(self, isCN = 1, back_coloring_path= None, text_path=None, font_path = None, stopwords_path = None, originimg = None, generateimg = None, background_color = None, max_words = 2000, max_font_size = 100, random_state = 42, width=1000, height=860, margin=2): back_coloring = imread(path.join(d, back_coloring_path)) # 设置背景图片 WordCloud.__init__(self, font_path=font_path, # 设置字体 background_color=background_color, # 背景颜色 max_words=max_words, # 词云显示的最大词数 mask=back_coloring, # 设置背景图片 max_font_size=max_font_size, # 字体最大值 random_state=random_state, width=width, height=height, margin=margin) self.isCN = isCN self.text_path = text_path self.stopwords_path = stopwords_path self.originimg = originimg self.generateimg = generateimg self.back_coloring = back_coloring