# -*- 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'):
yxkfw
- 粉丝: 82
- 资源: 2万+
最新资源
- 图像处理领域基于动态直方图均衡化的智能对比度增强技术研究与应用
- 红外小弱目标检测中的周期移位视觉图卷积网络CS-ViG-UNet模型及其应用
- 基于springboot+vue前后端分离的校园互助系统源码+数据库+文档说明(毕业设计)
- 基于springboot+vue的校园互助系统源码+数据库+文档说明(Java毕业设计)
- 基于Java+springboot+vue前后端分离的校园互助系统源码+数据库+文档说明(高分毕业设计)
- CIFAR-10 数据集的机器学习建模及Web-Demo部署:模型训练与优化流程详解
- 前端框架技术第8次作业.zip
- 网络工程项目实战:基于Python实现远程视频会议系统
- 单相单极性SPWM调制的电压型逆变仿真 自己搭建的单极性SPWM发波模块,可以方便的设置载波和调制波频率,以及调制比
- 三相PWM整流器闭环仿真,电压电流双闭环控制,输出直流电压做外环 模型中包含主电路,坐标变,电压电流双环PI控制器,SVPWM控制,PWM发生器 matlab simulink模型 功率因数1,低TH
- 基于容积卡尔曼以及滑膜控制的的永磁同步电机无传感器控制,无传感器采用的是容积卡尔曼滤波对转速及转子位置进行估计,也可替成平方根容积卡尔曼,高阶容积卡尔曼来估计状态,具体价格可加好友 转速环采用滑膜控
- 基于物联网传感器的变压器数字化转型-施耐德电气EcoStruxure Transformer Expert解决方案
- DSP28335与FPGA进行SPI通信,DSP为C语言代码,FPGA为verilog代码
- 自动驾驶纵向控制-复现Apollo双pid纵向位置跟踪 复现百度apollo纵向控制 纵向控制已经制作好油门刹车标定表,无需自己做标定
- 基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型
- 基于springboot旅游管理系统设计与实现源码+数据库+部署说明+数据库设计(高分毕业设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页