execfile() 函数可以用来执行一个文件。每组词 www.cgewang.com
以下是 execfile() 方法的语法:
execfile(filename[, globals[, locals]])
返回表达式执行结果。
以下展示了使用 execfile 函数的实例:
假设文件 hello.py,内容如下:
print(‘runoob‘);
Python execfile() 函数
原文:https://www.cnblogs.com/yc10086/p/13379616.html