获取python文件中的特定函数执行结果
来源:互联网 发布:考公务员 知乎 编辑:程序博客网 时间:2024/06/15 12:55
获取python文件中的特定函数执行结果
class CGlobal: @staticmethod def GetPyMod(strPyFile): #insert to directory into sys path strPyDir = os.path.dirname(strPyFile) if not strPyDir in sys.path: sys.path.insert(0, strPyDir) strImportPy = os.path.basename(strPyFile).split('.')[0] return __import__(strImportPy) @staticmethod def GetMonitorFunc(strPyFile): ''' must eixst def GetDataList(mapArg) --> list function ''' oMod = CGlobal.GetPyMod(strPyFile) return getattr(oMod, 'GetDataList') @staticmethod def GetCheckerFunc(strPyFile): ''' must exist def CheckDataList(strParam, lsData) --> check failed throw exception ''' oMod = CGlobal.GetPyMod(strPyFile) return getattr(oMod, 'CheckDataList')
阅读全文
0 0
- 获取python文件中的特定函数执行结果
- 获取python执行shell命令的结果
- sh 获取 执行python的结果:$?
- python获取os.system的执行结果
- 执行命令并获取结果函数
- 获取.sh文件的执行结果
- GDB秘技--调试时执行代码中的特定函数
- python中的交互执行函数
- Python中的字符串执行函数
- 获取线程执行结果
- 获取SYSTEM()执行结果
- 获取特定文件路径的函数glob.glob()
- popen C函数获取linux命令的执行结果
- 获取shell执行结果,不创建实际文件
- 导出redis中的特定 key值中的结果 并输出到文件
- 使用python 提取html文件中的特定数据
- 使用python 提取html文件中的特定数据
- 使用python 提取html文件中的特定数据
- Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)
- 题目448-寻找最大数
- CodeChef:Centeroid(树的构造)
- PowerDesigner(一)-PowerDesigner概述(系统分析与建模)
- win10之dlib安装过程(c++调用库,非python版)
- 获取python文件中的特定函数执行结果
- python-caffe接口学习(Solving in Python with LeNet)
- PowerDesigner(二)-项目和框架矩阵
- 面试的时候应该怎么介绍自己(2)
- nginx tips
- PowerDesigner(三)-企业架构模型
- maven个人实战总结&FAQ
- Android 中利用 ksoap2 调用 WebService
- gitlab Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)