from wordcloud import WordCloud #词云 import jieba #分词 from matplotlib import pyplot as plt #绘图 数据可视化 from PIL import Image #图像处理 import numpy as np import sqlite3
#连接数据库获取数据 conn = sqlite3.connect('movie.db') cur= conn.cursor() sql =''' select dec from movie250 ''' data=cur.execute(sql) text="" for item in data: text = text+item[0] cur.close() conn.close()