从以字符串表示的代码中动态加载函数。
dynamic-function-loader的Python项目详细描述
动态函数加载器
安装
pip install dynamic-function-loader
概述
dynamicfunctionloader允许从string
将Python函数动态加载到当前执行环境中。在
用法
^{pr2}$注
导入函数使用的所有Python包都必须在函数本身中加载。例如:
deffoo(regex):importrereturnre.compile(regex)
- 项目
标签: