aboutsummaryrefslogtreecommitdiff
path: root/lib/python/python.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/python.cpp')
-rw-r--r--lib/python/python.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/python/python.cpp b/lib/python/python.cpp
index ad029fb6..b7a4cf38 100644
--- a/lib/python/python.cpp
+++ b/lib/python/python.cpp
@@ -133,6 +133,16 @@ ePython::~ePython()
Py_Finalize();
}
+int ePython::execFile(const char *file)
+{
+ FILE *fp = fopen(file, "r");
+ if (!fp)
+ return -ENOENT;
+ int ret = PyRun_SimpleFile(fp, file);
+ fclose(fp);
+ return ret;
+}
+
int ePython::execute(const std::string &pythonfile, const std::string &funcname)
{
ePyObject pName, pModule, pDict, pFunc, pArgs, pValue;