|
@@ -73,6 +73,8 @@ func ExecPythonCode(edbCode, reqCode string) (dataMap EdbDataFromPython, err err
|
|
|
}
|
|
|
}()
|
|
|
|
|
|
+ AnalysisPythonCode(reqCode)
|
|
|
+
|
|
|
//获取python文件的绝对地址
|
|
|
pythonFile, err := getPythonFileAbsolutePath(edbCode)
|
|
|
if err != nil {
|
|
@@ -147,7 +149,7 @@ func ExecPythonCode(edbCode, reqCode string) (dataMap EdbDataFromPython, err err
|
|
|
}
|
|
|
|
|
|
//err = json.Unmarshal([]byte(resultStr), &dataMap)
|
|
|
- fmt.Println(dataMap)
|
|
|
+ //fmt.Println(dataMap)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -181,3 +183,14 @@ func getPythonFrontStr() string {
|
|
|
func getPythonLaterStr() string {
|
|
|
return "\nprint(\"result=\", result.to_json())\ndb.close()"
|
|
|
}
|
|
|
+
|
|
|
+// AnalysisPythonCode 解析Python代码,获取关联code
|
|
|
+func AnalysisPythonCode(pythonCode string) (dataMap EdbDataFromPython, err error, errMsg string) {
|
|
|
+ //edbCodeList := make([]string, 0)
|
|
|
+
|
|
|
+ tmpList := strings.Split(pythonCode, "\n")
|
|
|
+ for _, v := range tmpList {
|
|
|
+ fmt.Println(v)
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|