python应用GUI开发系列:
python利用PyQt5和QTDesginer开发GUI应用(一)、环境准备及demo
-------------------------------------------------------------------------------------------------------------------
这里使用tushare实时采集财经类信息。是个爬虫包,作者大大是我的同事Jimmy,Liu。
建议大家试用一下:
http://tushare.org/newsevent.html
--------------------------------------------------------------------------------------------------------------------
先看ui:源码在后面或查看附件。源码
功能:
查看股票信息:
实时交易:
历史大单:
历史交易:
大盘指数:
新股:
龙虎榜:
近五日上榜统计:
fund_search_show_ui.py
import sys
from PyQt5 import QtWidgets,QtCore
from PyQt5.QtCore import QDate,QDateTime,QTime,Qt
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from fund_search import Ui_Form
import tushare as ts
import pandas as pd
import datetime
#显示所有列
pd.set_option('display.max_rows',500)
pd.set_option('display.max_columns',500)
pd.set_option('display.width',1000)
class mywindow(QtWidgets.QWidget, Ui_Form):
fund_id = '002400'
plaintxt = ''
vol='100'
deal_date=datetime.datetime.now().strftime("%Y-%m-%d")
head_cnt=20
cm_basic={
"code": "代码",
"name": "名称",
"industry": "细分行业",
"area": "地区",
"pe": "市盈率",
"outstanding": "流通股本",
"totals": "总股本(万)",
"totalAssets": "总资产(万)",
"liquidAssets": "流动资产",
"fixedAssets": "固定资产",
"reserved": "公积金",
"reservedPerShare": "每股公积金",
"eps": "每股收益",
"bvps": "每股净资",
"pb": "市净率",
"timeToMarket": "上市日期"
}
cm_dapan={