首页 > 其他 > 详细

利用字典获取到数据里面相对应的值

时间:2018-07-31 23:13:51      阅读:180      评论:0      收藏:0      [点我收藏+]

{‘orders‘: {‘result‘: [{‘createtime‘: 1533044383000, ‘filledamount‘: ‘0‘, ‘filledquantity‘: ‘0‘, ‘orderid‘: ‘201807312139426110018131‘, ‘orderquantity‘: ‘4‘, ‘orderstatus‘: ‘unfilled‘, ‘price‘: ‘0.0005‘, ‘symbol‘: ‘ZIBERUSDT‘, ‘type‘: ‘buy-limit‘}, {‘createtime‘: 1533044373000, ‘filledamount‘: ‘0‘, ‘filledquantity‘: ‘0‘, ‘orderid‘: ‘201807312139327250013932‘, ‘orderquantity‘: ‘6‘, ‘orderstatus‘: ‘unfilled‘, ‘price‘: ‘0.001‘, ‘symbol‘: ‘ZIBERUSDT‘, ‘type‘: ‘sell-limit‘}], ‘totalcount‘: 2, ‘pagesize‘: 200, ‘page‘: 1}, ‘status‘: ‘ok‘, ‘timestamp‘: 1533044391442}

上面这些都是数据,也是请求出来,现在要获取这里面的orderid相对应的值.

    orders = post_open_orders(dic)
    for order in orders["orders"]["result"]:
        dic["orderid"] = order["orderid"]
        print(dic)

 

利用字典获取到数据里面相对应的值

原文:https://www.cnblogs.com/zengsf/p/9398456.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!