# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ChooseUI.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtCore import *
import pandas as pd
from pyecharts import Geo,Line,Bar
from pyecharts import Overlap
import jieba
from wordcloud import WordCloud, ImageColorGenerator
import matplotlib.pyplot as plt
import sys
from os import path
import urllib.request
import collections
import json
import os
import imageio
import re
# 显示热力图,主要城市评论数_平均分页面
class MainWindows(QMainWindow):
def __init__(self):
super(QMainWindow,self).__init__()
self.setGeometry(200, 200, 1250, 650)
self.browser = QWebEngineView()
def kk(self,title,hurl):
self.setWindowTitle(title)
url = d+'/'+hurl
self.browser.load(QUrl(url))
self.setCentralWidget(self.browser)
# 显示词云图片页面
class MainWindowy(QMainWindow):
def __init__(self):
super(QMainWindow,self).__init__()
self.setGeometry(200, 200, 650, 650)
self.browser = QLabel()
def kk(self,title,hurl):
self.setWindowTitle(title)
url = d+'/'+hurl
# self.browser.setBackgroundRole()
# 理由pixmap解析图片
pixmap = QPixmap(url)
# 等比例缩放图片
scaredPixmap = pixmap.scaled(QSize(600, 600), aspectRatioMode=Qt.KeepAspectRatio)
# 设置图片
self.browser.setPixmap(scaredPixmap)
# 判断选择的类型 根据类型做相应的图片处理
self.browser.show()
self.setCentralWidget(self.browser)
# 主窗体
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(382, 206)
self.horizontalLayoutWidget = QtWidgets.QWidget(Form)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(70, 20, 251, 51))
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(self.horizontalLayoutWidget)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.comboBox = QtWidgets.QComboBox(self.horizontalLayoutWidget)
self.comboBox.setDuplicatesEnabled(False)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.horizontalLayout.addWidget(self.comboBox)
self.pushButton = QtWidgets.QPushButton(self.horizontalLayoutWidget)
self.pushButton.setObjectName("pushButton")
self.horizontalLayout.addWidget(self.pushButton)
self.verticalLayoutWidget = QtWidgets.QWidget(Form)
self.verticalLayoutWidget.setGeometry(QtCore.QRect(80, 80, 235, 89))
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_2 = QtWidgets.QLabel(self.verticalLayoutWidget)
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName("label_2")
self.horizontalLayout_2.addWidget(self.label_2)
self.pushButton_2 = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.pushButton_2.setObjectName("pushButton_2")
self.horizontalLayout_2.addWidget(self.pushButton_2)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.label_3 = QtWidgets.QLabel(self.verticalLayoutWidget)
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName("label_3")
self.horizontalLayout_3.addWidget(self.label_3)
self.pushButton_3 = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.pushButton_3.setObjectName("pushButton_3")
self.horizontalLayout_3.addWidget(self.pushButton_3)
self.verticalLayout.addLayout(self.horizontalLayout_3)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.label_4 = QtWidgets.QLabel(self.verticalLayoutWidget)
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName("label_4")
self.horizontalLayout_4.addWidget(self.label_4)
self.pushButton_4 = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.pushButton_4.setObjectName("pushButton_4")
self.horizontalLayout_4.addWidget(self.pushButton_4)
self.verticalLayout.addLayout(self.horizontalLayout_4)
self.hide()
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
# 隐藏查看内容
def hide(self):
self.pushButton_4.setVisible(False)
self.label_4.setVisible(False)
self.pushButton_3.setVisible(False)
self.label_3.setVisible(False)
self.label_2.setVisible(False)
self.pushButton_2.setVisible(False)
# 显示查看内容
def show(self):
self.pushButton_4.setVisible(True)
self.label_4.setVisible(True)
self.pushButton_3.setVisible(True)
self.label_3.setVisible(True)
self.label_2.setVisible(True)
self.pushButton_2.setVisible(True)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "开心麻花影视作品分析"))
self.label.setText(_translate("Form", "选择电影:"))
self.comboBox.setItemText(0, _translate("Form", "夏洛特烦恼"))
self.comboBox.setItemText(1, _translate("Form", "羞羞的铁拳"))
self.comboBox.setItemText(2, _translate("Form", "西虹市首富"))
self.pushButton.setText(_translate("Form", "分析"))
self.label_2.setText(_translate("Form", "主要城市评论数及平均分"))
self.pushButton_2.setText(_translate("Form", "查看"))
self.label_3.setText(_translate("Form", " 热力图"))
self.pushButton_3.setText(_translate("Form", "查看"))
self.label_4.setText(_translate("Form", " 词云"))
self.pushButton_4.setText(_translate("Form", "查看"))
# 电影选择事件
self.comboBox.activated[str].connect(self.itemchange)
# 分析功能
self.pushButton.clicked.connect(self.anal)
# 判断是否有词云图片
if not os.path.isfile(d + '夏洛特烦恼词云.png'):
self.pushButton.setText('分析')
self.hide()
else:
self.pushButton.setText('完成重新分析')
self.moveName = '夏洛特烦恼'
self.moveId = '246082'
self.show()
self.btnclick()
# 绑定电影选择处理方法
def itemchange(self,text):
# 判断下拉列表改变后的内容是什么
if text =='夏洛特烦恼':
# 判断文件是否存在
if not os.path.isfile(d + '夏洛特烦恼词云.png'):
0and1调研
- 粉丝: 17
- 资源: 1176
最新资源
- 35 财务汇报部门历年薪酬统计图表.xlsx
- 39 财务工资发放表.xlsx
- 37 财务工资支出上半年年中总结报告.xlsx
- 38 财务分析工资年度开支表.xlsx
- 41 财务公司部门工资开支分析表.xlsx
- 40 财务分析部门工资支出图表.xlsx
- 42 部门员工工资统计表.xlsx
- 45 年度薪酬费用统计表.xlsx
- 44 人事薪酬管理台账.xlsx
- 48 工资对比分析报表模板.xls
- 47 可视化工资表自动统计1.xlsx
- 46 企业员工工资支出预算表.xlsx
- 43 工资收入对比分析表.xlsx
- 50 薪资分析图表.xlsx
- 49 薪酬数据统计分析报表excel模板.xlsx
- 年度公司薪酬调查分析方案(完整版).docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
- 3
前往页