_config

设置全局配置和日志记录器。

函数

tempconfig(temp)[source]

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

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

Parameters:

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

Return type:

生成器[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