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

{'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