日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

主要展示Qt與Python的結合

系統 1965 0

qmlpython

Mixed programming based on QtQuick and Python

主要展示Qt與Python的結合

  • 主要依賴于pyotherside第三方庫
  • 結合Python3.0
  • 結合QtQuick插件式開發
  • 結合第三方Python功能庫進行功能開發

展示效果

全球數字貨幣

主要展示Qt與Python的結合_第1張圖片

A股上市公司一覽

主要展示Qt與Python的結合_第2張圖片

某股日線數據

主要展示Qt與Python的結合_第3張圖片

新股上市一覽

主要展示Qt與Python的結合_第4張圖片

全球數字貨幣交易所

主要展示Qt與Python的結合_第5張圖片

展示代碼

            
                  ///獲取金融相關數據
    function getCoinlist(functionName,pageId){
        loading = true;
        var functionId = 'qrc_example.'+functionName;
        py.call(functionId, '', function(result) {
            // Load the received data into the list model
            //console.log("pageId"+pageId+ "result: " + result.length);
            loading = false;
            try{
            var obj = JSON.parse(result);
            if(typeof obj ==='object'){
                for(var i in obj) {
                    //if(obj[i].cn_name == null)continue;
                    pageId.myModel.append(obj[i]);
                }
            }
            }
            catch(e){
                console.log("============error=====");
                aniId.visible = true;
                aniId.setTooltips("接口出錯啦............");
                aniId.start();
            }
        });
    }

            
          
            
              # Python 代碼 注意其中的token替換為自己的
import pyotherside
import os.path
import sys
import tushare as ts
from io import StringIO
print('Hello from module!')
print(sys.path)

print('='*30)
def getstockbase():
    print('start=====SSE=========')
    ts.set_token('e53a32fc435f5fc25ab450333bda9d545856f1dfa1afc3d11699edcc')
    pro = ts.pro_api()
    df = pro.stock_basic(exchange_id='SSE', list_status='L', fields='ts_code,symbol, name,area,industry,fullname, enname, market,exchange, curr_type, list_status, list_date, delist_date,is_hs')
    return (df.to_json(orient='index'))

def getcoinlist():
    ts.set_token('e53a32fc435f5fc25ab450333bda9d545856f1dfa1afc3d11699edcc')
    pro = ts.pro_api()
    df1 = pro.coinlist(start_date='20080101', end_date='20141231')
    return (df1.to_json(orient='index'))

def coinexchanges():
    ts.set_token('e53a32fc435f5fc25ab450333bda9d545856f1dfa1afc3d11699edcc')
    pro = ts.pro_api()
    df1 = pro.coinexchanges(area_code='us')
    df1 = df1.sort('pairs', ascending=False)
    return (df1.to_json(orient='index'))

def dailyK():
    ts.set_token('e53a32fc435f5fc25ab450333bda9d545856f1dfa1afc3d11699edcc')
    pro = ts.pro_api()
    df = pro.daily(ts_code='000001.SZ', start_date='20180701', end_date='20190518')
    return (df.to_json(orient='index'))

def new_share():
    ts.set_token('e53a32fc435f5fc25ab450333bda9d545856f1dfa1afc3d11699edcc')
    pro = ts.pro_api()
    df = pro.new_share(start_date='20180901', end_date='20190618')
    return (df.to_json(orient='index'))

def coinexchanges():
    ts.set_token('e53a32fc435f5fc25ab450333bda9d545856f1dfa1afc3d11699edcc')
    pro = ts.pro_api()
    df = pro.coinexchanges()
    return (df.to_json(orient='index'))

def jinse():
    ts.set_token('e53a32fc435f5fc25ab450333bda9d545856f1dfa1afc3d11699edcc')
    pro = ts.pro_api()
    df = pro.jinse(start_date='2019-05-17 16:00:00', end_date='2019-06-04 18:00:00', \
                    fields='title, type, datetime')
    return (df.to_json(orient='index'))
print('='*30)


            
          

憧憬

  • 實現國內針對QtQuick與Python結合
  • 擴大QtQuick在Python領域的使用
  • 讓Python庫成為Qt的一個強力的類庫

貢獻

  • 源碼入口
  • 寒山-居士
  • toby520
  • cms多多指教

更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 深泽县| 平邑县| 长治县| 古丈县| 东至县| 南江县| 正定县| 娱乐| 内丘县| 黄骅市| 务川| 冷水江市| 临海市| 甘孜| 石屏县| 晋江市| 阿拉善右旗| 天门市| 武平县| 巩留县| 桂东县| 融水| 内乡县| 科尔| 繁峙县| 栾川县| 安岳县| 桂林市| 张家界市| 贵州省| 三亚市| 白朗县| 灵石县| 土默特左旗| 施甸县| 老河口市| 吉水县| 繁昌县| 宝山区| 彭水| 菏泽市|