_config

设置全局配置和日志器。

函数

tempconfig(temp)[源]

临时修改全局 config 对象的上下文管理器。

with 语句块内部,将使用修改后的配置。上下文管理器退出后,配置将恢复到其原始状态。

参数:

temp (ManimConfig | dict[str, Any]) – 其键将用于临时更新全局 config 的对象。

返回类型:

生成器[None, None, None]

示例

使用 with tempconfig({...}) 临时更改某些配置选项的默认值。

>>> config["frame_height"]
8.0
>>> with tempconfig({"frame_height": 100.0}):
...     print(config["frame_height"])
100.0
>>> config["frame_height"]
8.0