Skip to main content
 首页 » 编程设计

python之python中带大括号的参数

2025年05月04日9傻小

如果您查看以下 python 代码行:

bpy.ops.object.particle_system_add({"object":bpy.data.objects[2]}) 

你看到在参数中有一些东西用大括号括起来了。谁能告诉我牙套的用途(总的来说)?我还没有真正在 Python 中看到过这种类型的语法,也找不到任何相关文档。

非常感谢任何帮助。谢谢。

请您参考如下方法:

From the docs :

Dictionaries can be created by placing a comma-separated list of key: value pairs within braces, for example: {'jack': 4098, 'sjoerd': 4127} or {4098: 'jack', 4127: 'sjoerd'}, or by the dict constructor.