def wordcloudtest(self): from pyecharts import WordCloud import random wd = WordCloud('回帖数词云图') key, value = wd.cast(self.wordcloud) shapes = [ 'circle', 'cardioid', 'diamond', 'triangle-forward', 'triangle', 'pentagon', 'star' ] wd.add('', key, value, shape=shapes[0]) wd.render(r'pic\主要发帖人词云图.html') print('词云图测试成功')