- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
尝试从我的 json 中获取这些数据:
O2FDSFDSN47U-BFSDFSDWO3-TTFSDFS245H
OIBKDFSDFS2B-K6A2FSDFSDO-2GPFSDFSNES
OSZZEE-FDSDQUNAZ-OHDSQDQS2NDS
使用 print(data['result']['open'])
:但返回 id
之后的所有数据。
这些id
还在动,我猜不出来。使用正则表达式似乎不是一个好主意
没有别的,但是当使用我的 python 解析器时,我总是得到子数据。
{
"error": [],
"result": {
"open": {
"O2FDSFDSN47U-BFSDFSDWO3-TTFSDFS245H": {
"refid": null,
"userref": 0,
"status": "open",
"starttm": 0,
"expiretm": 0,
"descr": {
"ordertype": "limit",
"price": "3",
"price2": "0",
"leverage": "none",
"close": ""
},
"vol": "1.00000000",
"vol_exec": "0.00000000",
"cost": "0.00000",
"fee": "0.00000",
"price": "0.00000",
"stopprice": "0.00000",
"limitprice": "0.00000",
"misc": "",
"oflags": "fcib"
},
"OIBKDFSDFS2B-K6A2FSDFSDO-2GPFSDFSNES": {
"refid": null,
"userref": 0,
"status": "open",
"starttm": 0,
"expiretm": 0,
"descr": {
"ordertype": "limit",
"price": "1.5",
"price2": "0",
"leverage": "none",
"close": ""
},
"vol": "2.00000000",
"vol_exec": "0.00000000",
"cost": "0.00000",
"fee": "0.00000",
"price": "0.00000",
"stopprice": "0.00000",
"limitprice": "0.00000",
"misc": "",
"oflags": "fciq"
},
"OSZZEE-FDSDQUNAZ-OHDSQDQS2NDS": {
"refid": null,
"userref": 0,
"status": "open",
"starttm": 0,
"expiretm": 0,
"descr": {
"ordertype": "limit",
"price": "9",
"price2": "0",
"leverage": "none",
"close": ""
},
"vol": "1.00000000",
"vol_exec": "0.00000000",
"cost": "0.00000",
"fee": "0.00000",
"price": "0.00000",
"stopprice": "0.00000",
"limitprice": "0.00000",
"misc": "",
"oflags": "fciq"
}
}
}
}
如何一举拿下论文?
最佳答案
import json
s = '''{
"error": [],
"result": {
"open": {
"O2FDSFDSN47U-BFSDFSDWO3-TTFSDFS245H": {
"refid": null,
"userref": 0,
"status": "open",
"starttm": 0,
"expiretm": 0,
"descr": {
"ordertype": "limit",
"price": "3",
"price2": "0",
"leverage": "none",
"close": ""
},
"vol": "1.00000000",
"vol_exec": "0.00000000",
"cost": "0.00000",
"fee": "0.00000",
"price": "0.00000",
"stopprice": "0.00000",
"limitprice": "0.00000",
"misc": "",
"oflags": "fcib"
},
"OIBKDFSDFS2B-K6A2FSDFSDO-2GPFSDFSNES": {
"refid": null,
"userref": 0,
"status": "open",
"starttm": 0,
"expiretm": 0,
"descr": {
"ordertype": "limit",
"price": "1.5",
"price2": "0",
"leverage": "none",
"close": ""
},
"vol": "2.00000000",
"vol_exec": "0.00000000",
"cost": "0.00000",
"fee": "0.00000",
"price": "0.00000",
"stopprice": "0.00000",
"limitprice": "0.00000",
"misc": "",
"oflags": "fciq"
},
"OSZZEE-FDSDQUNAZ-OHDSQDQS2NDS": {
"refid": null,
"userref": 0,
"status": "open",
"starttm": 0,
"expiretm": 0,
"descr": {
"ordertype": "limit",
"price": "9",
"price2": "0",
"leverage": "none",
"close": ""
},
"vol": "1.00000000",
"vol_exec": "0.00000000",
"cost": "0.00000",
"fee": "0.00000",
"price": "0.00000",
"stopprice": "0.00000",
"limitprice": "0.00000",
"misc": "",
"oflags": "fciq"
}
}
}
}'''
data = json.loads(s)
>>> data['result']['open'].keys()
dict_keys(['O2FDSFDSN47U-BFSDFSDWO3-TTFSDFS245H', 'OIBKDFSDFS2B-K6A2FSDFSDO-2GPFSDFSNES', 'OSZZEE-FDSDQUNAZ-OHDSQDQS2NDS'])
>>>
关于python - 如何在没有子数据的情况下获取值(value)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56213235/
这个问题在这里已经有了答案: final keyword in method parameters [duplicate] (9 个回答) 关闭 8 年前。 在此示例中,声明 Object fina
我的目标:是通过我的函数更新字段获取选定值并使用函数输出值运行它。 问题:当我从列表中选择值时,它不会触发函数,也不会更新字段。 感谢您的帮助。 HTML 12 14 16 18 20 22 24
我有一本具有这种形式的字典: myDict = {'foo': bar, 'foobar baz': qux} 现在,我想拆分字典键中的空格,使其成为下一个键并获取值(重复)。 myDictRev1
vector a; vector b; int temp_holder; cout > temp_holder) a.push_back(temp_holder); cout > temp_h
Java 的开发过程中免不了与 Date 类型纠缠,准备总结一下项目经常使用的日期相关操作,JDK 版本 1.7,如果能够帮助大家节约那么几分钟起身活动一下,去泡杯咖啡,便是极好的,嘿嘿。当然,我
我正在使用 jquery ui 日期选择器来获取 fromDate 和 toDate 以下是from日期的代码 $("#from_date").datepicker({
我是一名优秀的程序员,十分优秀!