用户:青柠学长查看:0 回复:0 评论:0 创建时间:2022-05-28T21:17:54
【作品展示】

【作品介绍】
运行在第六行总报错,报错plots库没安装,但是我已经把所有的plots库下载了。。。。。
【作品源代码】
import os
import sys
from PySide2.QtWidgets import *
from ui_charts import Ui_Charts
from plots import plots
from PySide2.QtCore import QUrl
from PySide2.QtWebEngineWidgets import QWebEngineView
class Mycharts(QMainWindow, Ui_Charts):
def __init__(self):
super().__init__()
self.setupUi(self)
self.init_set()
self.show()
self.pbtn_data.clicked.connect(self.select_file)
self.cb_chart_list.currentIndexChanged.connect(self.plot)
def init_set(self):
self.browser = QWebEngineView()
self.vl_chart.addWidget(self.browser)
def select_file(self):
self.data_file,_ = QFileDialog.getOpenFileName(
caption="选择数据文件", filter="(*.json)")
self.lb_info.setText(self.data_file)
def plot(self):
index_text = self.cb_chart_list.currentText()
if self.data_file:
plots(self.data_file,index_text)
self.browser.load(QUrl.fromLocalFile(os.path.realpath("render.html")))
if __name__ == '__main__':
app = QApplication(sys.argv)
window = Mycharts()
sys.exit(app.exec_())
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn