odoo11中的write和update方法之间有什么区别,因为当我使用write时,它仅在第一次工作时才起作用。
如何在python中访问嵌套字典.我想访问card和card1的' type '.
data = {
'1': {
'type': 'card',
'card[number]': 12345,
},
'2': {
'type': 'wechat',
'name': 'paras'
}}
Run Code Online (Sandbox Code Playgroud)
我只想从字典中输入.我怎样才能得到.我使用以下代码但收到错误:
>>> for item in data:
... for i in item['type']:
... print(i)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
TypeError: string indices must be integers
Run Code Online (Sandbox Code Playgroud)