gpt4 book ai didi

python - 以交互模式加载模块变量

转载 作者:行者123 更新时间:2023-11-30 23:35:27 27 4
gpt4 key购买 nike

每当我在交互式运行 python 时加载模块时,我通常都会这样做

some_variable = module.module_variable

获得更短的变量名称。

有没有办法将此变量从模块加载到交互式范围。这样我就不用重复了?

最佳答案

简单:

from module import function as func

关于python - 以交互模式加载模块变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17288936/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com