小编use*_*123的帖子

在odoo11中写入和更新之间的区别

odoo11中的write和update方法之间有什么区别,因为当我使用write时,它仅在第一次工作时才起作用。

python-3.x odoo odoo-11

2
推荐指数
1
解决办法
950
查看次数

如何在python中访问嵌套字典

如何在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)

python dictionary python-3.x

0
推荐指数
1
解决办法
473
查看次数

标签 统计

python-3.x ×2

dictionary ×1

odoo ×1

odoo-11 ×1

python ×1