IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> Python知识库 -> PYQT5界面历史股票数据下载 -> 正文阅读

[Python知识库]PYQT5界面历史股票数据下载

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'QH_Stock_His_Flow.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.

import sys,os
import requests
import json
import datetime
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QWidget,QApplication,QTableWidget,QTableWidgetItem
import pandas as qh_pd
import numpy as np

QH_Spider_URL = {'QH_Spider_00008': {'Spider_ID': 'QH_Spider_00008', 'Spider_Name': '东方财富_行情中心_历史行情', 'Method': 'GET', 'Is_Open': 'Y', 'URL': 'http://8.push2his.eastmoney.com/api/qt/stock/kline/get', 'Create_Date': '', 'QH_Spider_Header': 'QH_Spider_00008', 'QH_Spider_Params': 'QH_Spider_00008', 'QH_Spider_Payload': '', 'QH_Spider_Filed': 'QH_Spider_00008', 'qh_status': True}}
QH_Spider_Header = { 'QH_Spider_00008': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh-CN,zh;q=0.9', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', 'Cookie': 'em_hq_fls=js; em-quote-version=topspeed; qgqp_b_id=afef59e9f2ee07071bef89b8839162c8; ', 'Host': '40.push2his.eastmoney.com', 'Pragma': 'no-cache', 'Referer': 'http://quote.eastmoney.com/sz000002.html', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'}}
QH_Spider_Params = {'QH_Spider_00008': {'cb': 'jQuery0526', 'secid': '{}.{}', 'ut': 'fa5fd1943c7b386f172d6893dbfba10b', 'fields1': 'f1,f2,f3,f4,f5,f6', 'fields2': 'f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61', 'klt': '101', 'fqt': '0', 'end': '21000101', 'lmt': '1000000', '_': '1632572066447'}}
QH_Spider_Payload = {'QH_Spider_00039': {'format': 'json', '@limit': '10000'}}
QH_Spider_Filed = {'QH_Spider_00008': ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']}
QH_Spider_Filed_CN = {'QH_Spider_00008': ['周期', '周期名', '复权码', '复权名', '股票代码', '股票名称', '交易日期', '开盘价', '收盘价', '最高价', '最低价', '成交量', '成交额', '振幅', '涨跌幅', '涨跌额', '换手率']}

def Qh_OR_DF_LIST(QH_JieGuo_List,qh_Trading_day,qh_filed_cn,qh_out,qh_day_t):
    """
    DF000.配置函数             作者:阙辉
    :param QH_JieGuo_List:    结果列表
    :param qh_Trading_day:    交易日期
    :param qh_filed_cn:       中文名
    :param qh_out:            输出格式
    :param qh_day_t:          是否加交易日期
    :return:
    """
    if qh_day_t:  #是否要添加交易日期
        [qh_row.insert(0,qh_Trading_day) for qh_row in QH_JieGuo_List]
        qh_filed_cn.insert(0,"交易日期")
    qh_df = qh_pd.DataFrame(QH_JieGuo_List,columns = qh_filed_cn)
    if qh_out == "qh_df":
        return qh_df
    elif qh_out == "qh_list":
        return QH_JieGuo_List

class QH_kline_data(object):
    """
    初始化
    基类爬虫:
    不要默认参数:参数在爬虫外提供。
    作者:阙辉
    """
    def __init__(self, qh_url = "",
                       qh_headers = {},
                       qh_method = "",
                       qh_params = {},
                       qh_payload = {},
                       qh_filed = [],
                       qh_code="utf-8",
                       qh_proxy = {}):
        """
        初始化基本参数
        """
        self.qh_url = qh_url
        self.qh_headers = qh_headers
        self.qh_method = qh_method
        self.qh_params = qh_params
        self.qh_payload = qh_payload
        self.qh_filed = qh_filed
        self.qh_code = qh_code
        self.qh_proxy = qh_proxy

    def QH_Requests(self,qh_url, qh_headers, qh_params,qh_payload,qh_method = "",qh_code='utf-8',qh_proxy = {}):
        """
        请求函数            作者:阙辉
        :param qh_url:        url网址
        :param qh_headers:    头信息
        :param qh_params:     getURL参数
        :param qh_code:       解析格式
        :return:
        """
        qh_proxy = qh_proxy
        if qh_method == "" or qh_method == "GET":
            if qh_proxy == {}:
                qh_rep = requests.get(qh_url, headers=qh_headers, params=qh_params)
            else:
                qh_rep = requests.get(qh_url, headers=qh_headers, params=qh_params, proxies=qh_proxy)
        elif qh_method == "POST":
            if qh_proxy == {}:
                qh_rep = requests.post(qh_url, headers=qh_headers, data=qh_payload)
            else:
                qh_rep = requests.post(qh_url, headers=qh_headers, data=qh_payload, proxies=qh_proxy)
        print(qh_rep.url)              #打印网址
        qh_rep.encoding = qh_code
        qh_request = qh_rep.text

        return qh_request
    def QH_ChuShiHua_Data(self, qh_data):
        """初始化数据,将数据导入到json"""
        qh_data = qh_data
        qh_data = qh_data.replace("""jQuery0526(""", "[")
        qh_data = qh_data.replace(""");""", "]")
        qh_data = json.loads(qh_data)
        qh_data = qh_data[0]['data']
        # print(qh_data)
        qh_code = qh_data['code']  # 获取股票代码
        qh_name = qh_data['name']  # 获取股票名称
        qh_data_klines = qh_data['klines']
        qh_data_klines_list = []  # 初始化结果列表
        for qh_klines_row in qh_data_klines:
            qh_klines_row_list = qh_klines_row.split(""",""")
            qh_klines_row_list.insert(0, qh_name)  # 添加名称
            qh_klines_row_list.insert(0, qh_code)  # 添加代码
            qh_data_klines_list.append(qh_klines_row_list)
        return qh_data_klines_list

    def QH_Spider_Main_List(self):
        """
        重写主程序
        :return:
        """
        qh_url = self.qh_url
        qh_headers = self.qh_headers
        qh_method = self.qh_method
        qh_payload = self.qh_payload
        qh_params = self.qh_params
        qh_filed = self.qh_filed
        qh_code = self.qh_code
        qh_proxy = self.qh_proxy
        self.qh_requs = self.QH_Requests(qh_url, qh_headers, qh_params, qh_payload,
                                         qh_method=qh_method, qh_code=qh_code, qh_proxy=qh_proxy)
        self.qh_data = self.QH_ChuShiHua_Data(self.qh_requs)
        qh_JieGuo_list_All = self.qh_data
        return qh_JieGuo_list_All

def QH_ChuanCan_Request(QH_REQ_OBJ,qh_spider_id,
                        QH_Spider_URL,
                        QH_Spider_Header,
                        QH_Spider_Params,
                        QH_Spider_Payload,
                        QH_Spider_Filed,
                        QH_Spider_Filed_CN):
    """
    绑定请求参数   作者:阙辉
    :param QH_REQ_OBJ:     传入对应爬虫对象
    :param qh_spider_id:   爬虫id
    :return:
    """
    #传入参数
    # QH_Spider_URL = qh_json_sets.QH_Spider_URL
    # QH_Spider_Header = qh_json_sets.QH_Spider_Header
    # QH_Spider_Params = qh_json_sets.QH_Spider_Params
    # QH_Spider_Payload = qh_json_sets.QH_Spider_Payload
    # QH_Spider_Filed = qh_json_sets.QH_Spider_Filed
    # QH_Spider_Filed_CN = qh_json_sets.QH_Spider_Filed_CN
    #爬虫请求参数
    QH_Spider_URL = QH_Spider_URL[qh_spider_id]
    qh_method = QH_Spider_URL["Method"]
    qh_is_open = QH_Spider_URL["Is_Open"]
    qh_url = QH_Spider_URL["URL"]
    try:
        qh_header = QH_Spider_Header[QH_Spider_URL["QH_Spider_Header"]]
    except:
        qh_header = {}
    try:
        qh_params = QH_Spider_Params[QH_Spider_URL["QH_Spider_Params"]]
    except:
        qh_params = {}
    try:
        qh_payload = QH_Spider_Payload[QH_Spider_URL["QH_Spider_Payload"]]
    except:
        qh_payload = {}
    try:
        qh_filed = QH_Spider_Filed[QH_Spider_URL["QH_Spider_Filed"]]
        qh_filed_cn = QH_Spider_Filed_CN[QH_Spider_URL["QH_Spider_Filed"]]
    except:
        qh_filed = []
        qh_filed_cn = []
    #绑定参数到请求对象
    QH_REQ_OBJ.qh_url = qh_url
    QH_REQ_OBJ.qh_headers = qh_header
    QH_REQ_OBJ.qh_method = qh_method
    QH_REQ_OBJ.qh_params = qh_params
    QH_REQ_OBJ.qh_payload = qh_payload
    QH_REQ_OBJ.qh_filed = qh_filed
    QH_REQ_OBJ.qh_filed_cn = qh_filed_cn
    QH_REQ_OBJ.qh_is_open = qh_is_open
    return QH_REQ_OBJ

def Qh_DF_His_Flow_Interface01(qh_code,qh_stare_date = "1989-01-01",qh_end_date="2022-03-05",qh_klt = "",qh_fqt = "",qh_spider_id = "QH_Spider_00008",qh_out = "qh_df",qh_day_t = False):
    """
    历史行情接口  带日期
    :param qh_code:
    :param qh_klt:
    :param qh_fqt:
    :param qh_spider_id:
    :param qh_out:
    :param qh_day_t:
    :return:
    """
    qh_klt_list = [["天","101"],["周","102"],["月","103"]]
    qh_fqt_list = [["不复权","0"],["前复权","1"],["后复权","2"]]
    qh_stare_date1 = datetime.datetime.strptime(qh_stare_date, '%Y-%m-%d')
    qh_end_date1 = datetime.datetime.strptime(qh_end_date, '%Y-%m-%d')
    qh_cha_date =(qh_end_date1-qh_stare_date1).days
    print(qh_cha_date)
    QH_REQ_OBJ = QH_kline_data()
    QH_REQ_OBJ = QH_ChuanCan_Request(QH_REQ_OBJ,qh_spider_id,
                        QH_Spider_URL,
                        QH_Spider_Header,
                        QH_Spider_Params,
                        QH_Spider_Payload,
                        QH_Spider_Filed,
                        QH_Spider_Filed_CN)
    if qh_code[0:2] == "SZ" or qh_code[0:2] == "sz":
        qh_code = "{}.{}".format("0",qh_code[2:])
    elif qh_code[0:2] == "SH" or qh_code[0:2] == "sh":
        qh_code = "{}.{}".format("1",qh_code[2:])
    else:
        qh_code = "{}.{}".format("1", qh_code[2:])
    QH_REQ_OBJ.qh_params["secid"] = qh_code
    QH_REQ_OBJ.qh_params["lmt"] = qh_cha_date   #查询天数输入
    QH_REQ_OBJ.qh_params["end"] = qh_end_date.replace("-","")  # 查询天数输入
    QH_JieGuo_List = []
    if qh_klt == "" and qh_fqt == "":
        for qh_row in qh_klt_list:
            qh_klt = qh_row[1]
            qh_klt_name = qh_row[0]
            QH_REQ_OBJ.qh_params["klt"] = qh_klt
            for qh_row_01 in qh_fqt_list:
                qh_fqt = qh_row_01[1]
                qh_fqt_name = qh_row_01[0]
                QH_REQ_OBJ.qh_params["fqt"] = qh_fqt
                QH_JieGuo_List_row = QH_REQ_OBJ.QH_Spider_Main_List()  # 爬取数
                for qh_row_02 in QH_JieGuo_List_row:
                    qh_row_02.insert(0, qh_fqt_name)
                    qh_row_02.insert(0, qh_fqt)
                    qh_row_02.insert(0, qh_klt_name)
                    qh_row_02.insert(0, qh_klt)
                QH_JieGuo_List = QH_JieGuo_List_row + QH_JieGuo_List
    else:   #y
        qh_klt_list_d = dict(qh_klt_list)
        qh_fqt_list_d = dict(qh_fqt_list)
        if qh_klt !=""and qh_fqt =="":
            qh_klt_name = qh_klt
            qh_klt = qh_klt_list_d[qh_klt]
            QH_REQ_OBJ.qh_params["klt"] = qh_klt
            qh_fqt_name = "不复权"
            qh_fqt = qh_fqt_list_d[qh_fqt_name]
            QH_REQ_OBJ.qh_params["fqt"] = qh_fqt
        elif qh_klt ==""and qh_fqt !="":
            qh_klt_name = "天"
            qh_klt = qh_klt_list_d[qh_klt_name]
            qh_fqt_name = qh_fqt
            qh_fqt = qh_fqt_list_d[qh_fqt]
            QH_REQ_OBJ.qh_params["klt"] = qh_klt
            QH_REQ_OBJ.qh_params["fqt"] = qh_fqt
        elif qh_klt !=""and qh_fqt !="":
            qh_klt_name = qh_klt
            qh_klt = qh_klt_list_d[qh_klt]
            qh_fqt_name = qh_fqt
            qh_fqt = qh_fqt_list_d[qh_fqt]
            QH_REQ_OBJ.qh_params["klt"] = qh_klt
            QH_REQ_OBJ.qh_params["fqt"] = qh_fqt
        QH_JieGuo_List = QH_REQ_OBJ.QH_Spider_Main_List()  # 爬取数
        for qh_row in QH_JieGuo_List:
            qh_row.insert(0, qh_fqt_name)
            qh_row.insert(0, qh_fqt)
            qh_row.insert(0, qh_klt_name)
            qh_row.insert(0, qh_klt)
    qh_filed_cn = QH_REQ_OBJ.qh_filed_cn
    qh_Trading_day = ""
    QH_JieGuo = Qh_OR_DF_LIST(QH_JieGuo_List, qh_Trading_day, qh_filed_cn, qh_out, qh_day_t)
    return QH_JieGuo
# qh_code = "SZ000001"
# aa = Qh_DF_His_Flow_Interface01(qh_code,qh_stare_date = "1989-01-01",qh_end_date="2022-03-05",qh_klt = "",qh_fqt = "",qh_spider_id = "QH_Spider_00008",qh_out = "qh_df",qh_day_t = False)
# print(aa)

class myWindow(QWidget):
    def __init__(self,parent=None):

        super().__init__(parent)
        self.ui = Ui_Form()
        self.ui.setupUi(self)
        self.ui.pushButton.clicked.connect(self.qh_chaxun)
        self.ui.pushButton_2.clicked.connect(self.qh_daochu)
        self.qh_daochu = False

    def qh_select_clu(self,qh_df, qh_index, qh_select):
        qh_select = qh_select
        qh_select = [qh_select]
        qh_df["qh_index"] = qh_df[qh_index]
        qh_df.set_index("qh_index", drop=True, append=False, inplace=True)  # 设置索引
        qh__df = qh_df.loc[qh_select].fillna("")
        return qh__df

    def qh_table_wrid(self,qh_tableWidget,qh_df_list,qh_column):

        qh_df_row = len(qh_df_list)
        qh_column_len = len(qh_column)

        qh_tableWidget.setRowCount(qh_df_row)
        qh_tableWidget.setColumnCount(qh_column_len)
        qh_tableWidget.setHorizontalHeaderLabels(qh_column)  # 标题
        for i in range(qh_df_row):
            for j in range(qh_column_len):
                cell = QTableWidgetItem()
                cell.setText(qh_df_list[i][j])
                qh_tableWidget.setItem(i, j, cell)
        # self.ui.action_saveAs.setEnabled(True)
        # self.ui.action_total.setEnabled(True)
        # self.ui.action_average.setEnabled(True)

    def qh_chaxun(self):
        qh_code = self.ui.lineEdit.text()
        qh_start_date = str(self.ui.dateEdit.text())
        qh_end_date = str(self.ui.dateEdit_2.text())
        # print(qh_code)
        # print(qh_start_date)
        # print(qh_end_date)
        self.qh_his_df = Qh_DF_His_Flow_Interface01(qh_code,qh_stare_date = qh_start_date,qh_end_date=qh_end_date,qh_klt = "",qh_fqt = "",qh_spider_id = "QH_Spider_00008",qh_out = "qh_df",qh_day_t = False)
        qh_his_df = self.qh_his_df
        self.qh_daochu = True
        qh_column = [qh_row for qh_row in qh_his_df]

        qh_index = "复权码"
        qh_select = "0"
        qh_his_df_0 = self.qh_select_clu(qh_his_df, qh_index, qh_select)

        qh_index = "周期"
        qh_select = "101"
        qh_day_df = self.qh_select_clu(qh_his_df_0, qh_index, qh_select)
        qh_day_df_list = np.array(qh_day_df).tolist()

        qh_index = "周期"
        qh_select = "102"
        qh_week_df = self.qh_select_clu(qh_his_df_0, qh_index, qh_select)
        qh_week_df_list = np.array(qh_week_df).tolist()

        qh_index = "周期"
        qh_select = "103"
        qh_month_df = self.qh_select_clu(qh_his_df_0, qh_index, qh_select)
        qh_month_df_list = np.array(qh_month_df).tolist()

        self.qh_table_wrid(self.ui.tableWidget,qh_day_df_list,qh_column)
        self.qh_table_wrid(self.ui.tableWidget_2, qh_week_df_list, qh_column)
        self.qh_table_wrid(self.ui.tableWidget_3, qh_month_df_list, qh_column)

    def qh_daochu(self):
        if self.qh_daochu:
            try:
                print(self.qh_his_df)
                self.qh_his_df.to_excel("QH_his.xlsx",sheet_name="qh_his",encoding="gbk")
            except:
                printt("导出有错误")

class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(1150, 788)
        self.groupBox = QtWidgets.QGroupBox(Form)
        self.groupBox.setGeometry(QtCore.QRect(10, 10, 1121, 71))
        self.groupBox.setObjectName("groupBox")
        self.label = QtWidgets.QLabel(self.groupBox)
        self.label.setGeometry(QtCore.QRect(10, 30, 101, 21))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setTextFormat(QtCore.Qt.AutoText)
        self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label.setObjectName("label")
        self.lineEdit = QtWidgets.QLineEdit(self.groupBox)
        self.lineEdit.setEnabled(True)
        self.lineEdit.setGeometry(QtCore.QRect(110, 30, 151, 31))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.lineEdit.setFont(font)
        self.lineEdit.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        self.lineEdit.setMouseTracking(False)
        self.lineEdit.setStatusTip("")
        self.lineEdit.setAccessibleDescription("")
        self.lineEdit.setInputMethodHints(QtCore.Qt.ImhNone)
        self.lineEdit.setInputMask("")
        self.lineEdit.setFrame(True)
        self.lineEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.lineEdit.setPlaceholderText("")
        self.lineEdit.setClearButtonEnabled(False)
        self.lineEdit.setObjectName("lineEdit")
        self.pushButton = QtWidgets.QPushButton(self.groupBox)
        self.pushButton.setGeometry(QtCore.QRect(770, 30, 91, 31))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.pushButton.setFont(font)
        self.pushButton.setObjectName("pushButton")
        self.dateEdit = QtWidgets.QDateEdit(self.groupBox)
        self.dateEdit.setEnabled(True)
        self.dateEdit.setGeometry(QtCore.QRect(380, 30, 131, 31))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.dateEdit.setFont(font)
        self.dateEdit.setAlignment(QtCore.Qt.AlignCenter)
        self.dateEdit.setDateTime(QtCore.QDateTime(QtCore.QDate(1989, 1, 1), QtCore.QTime(0, 0, 0)))
        self.dateEdit.setObjectName("dateEdit")
        self.label_2 = QtWidgets.QLabel(self.groupBox)
        self.label_2.setGeometry(QtCore.QRect(280, 30, 101, 21))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.label_2.setFont(font)
        self.label_2.setTextFormat(QtCore.Qt.AutoText)
        self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName("label_2")
        self.dateEdit_2 = QtWidgets.QDateEdit(self.groupBox)
        self.dateEdit_2.setEnabled(True)
        self.dateEdit_2.setGeometry(QtCore.QRect(620, 30, 131, 31))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.dateEdit_2.setFont(font)
        self.dateEdit_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.dateEdit_2.setCurrentSection(QtWidgets.QDateTimeEdit.YearSection)
        self.dateEdit_2.setTimeSpec(QtCore.Qt.LocalTime)
        self.dateEdit_2.setObjectName("dateEdit_2")
        self.label_3 = QtWidgets.QLabel(self.groupBox)
        self.label_3.setGeometry(QtCore.QRect(520, 30, 101, 21))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.label_3.setFont(font)
        self.label_3.setTextFormat(QtCore.Qt.AutoText)
        self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_3.setObjectName("label_3")
        self.groupBox_2 = QtWidgets.QGroupBox(Form)
        self.groupBox_2.setGeometry(QtCore.QRect(10, 100, 1121, 601))
        self.groupBox_2.setObjectName("groupBox_2")
        self.tabWidget = QtWidgets.QTabWidget(self.groupBox_2)
        self.tabWidget.setGeometry(QtCore.QRect(10, 20, 1101, 571))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(False)
        font.setWeight(50)
        self.tabWidget.setFont(font)
        self.tabWidget.setObjectName("tabWidget")
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
        self.tableWidget = QtWidgets.QTableWidget(self.tab)
        self.tableWidget.setGeometry(QtCore.QRect(0, 0, 1092, 541))
        self.tableWidget.setMouseTracking(True)
        self.tableWidget.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(0)
        self.tableWidget.setRowCount(0)
        self.tabWidget.addTab(self.tab, "")
        self.tab_2 = QtWidgets.QWidget()
        self.tab_2.setObjectName("tab_2")
        self.tableWidget_2 = QtWidgets.QTableWidget(self.tab_2)
        self.tableWidget_2.setGeometry(QtCore.QRect(0, 0, 1092, 541))
        self.tableWidget_2.setObjectName("tableWidget_2")
        self.tableWidget_2.setColumnCount(0)
        self.tableWidget_2.setRowCount(0)
        self.tabWidget.addTab(self.tab_2, "")
        self.tab_3 = QtWidgets.QWidget()
        self.tab_3.setObjectName("tab_3")
        self.tableWidget_3 = QtWidgets.QTableWidget(self.tab_3)
        self.tableWidget_3.setGeometry(QtCore.QRect(0, 0, 1092, 541))
        self.tableWidget_3.setObjectName("tableWidget_3")
        self.tableWidget_3.setColumnCount(0)
        self.tableWidget_3.setRowCount(0)
        self.tabWidget.addTab(self.tab_3, "")
        self.groupBox_3 = QtWidgets.QGroupBox(Form)
        self.groupBox_3.setGeometry(QtCore.QRect(10, 710, 1121, 71))
        self.groupBox_3.setObjectName("groupBox_3")
        self.pushButton_2 = QtWidgets.QPushButton(self.groupBox_3)
        self.pushButton_2.setGeometry(QtCore.QRect(860, 20, 191, 41))
        self.pushButton_2.setObjectName("pushButton_2")

        self.retranslateUi(Form)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "股票历史交易数据_QH"))
        self.groupBox.setTitle(_translate("Form", "参数_操作_QH"))
        self.label.setText(_translate("Form", "股票代码:"))
        self.lineEdit.setText(_translate("Form", "SZ000001"))
        self.pushButton.setText(_translate("Form", "查询"))
        self.dateEdit.setDisplayFormat(_translate("Form", "yyyy-MM-dd"))
        self.label_2.setText(_translate("Form", "起始时间:"))
        self.dateEdit_2.setDisplayFormat(_translate("Form", "yyyy-MM-dd"))
        self.label_3.setText(_translate("Form", "结束时间:"))
        self.groupBox_2.setTitle(_translate("Form", "输出结果_QH"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("Form", "历史行情-天"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("Form", "历史行情-周"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("Form", "历史行情-月"))
        self.groupBox_3.setTitle(_translate("Form", "数据导出_QH"))
        self.pushButton_2.setText(_translate("Form", "下载 to Excel"))

if __name__ == "__main__":
	app = QApplication(sys.argv)
	widget = myWindow()
	widget.show()
	sys.exit(app.exec_())

  Python知识库 最新文章
Python中String模块
【Python】 14-CVS文件操作
python的panda库读写文件
使用Nordic的nrf52840实现蓝牙DFU过程
【Python学习记录】numpy数组用法整理
Python学习笔记
python字符串和列表
python如何从txt文件中解析出有效的数据
Python编程从入门到实践自学/3.1-3.2
python变量
上一篇文章      下一篇文章      查看所有文章
加:2022-03-08 22:24:55  更:2022-03-08 22:25:04 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年12日历 -2024/12/31 4:01:00-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码