python - python中带大括号的参数

标签 python parameters python-3.x curly-braces

如果您查看以下 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.

关于python - python中带大括号的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3010225/

相关文章:

python - 无法在 Conda 环境中安装 Gensim - 找不到 noarch 目录

python - 解析证书的 keyid - Python

php - 如何将输入文本框值的参数传递给 jQuery 中的 ajax

javascript - 将数组值作为参数传递会导致未定义

python - 使用 python shelf 类给出编码错误

Python smtplib 无法附加多个 mimetext

python-3.x - 收集推文时如何修复 KeyError 'statuses'?

函数的 Python 'self'

python - 我是否违反了任何基本的 OOP 规则?

ruby - + 具有多个参数的运算符