TIPTOP GP ERP 调用python 用法
LET l_cmd = "python ","/u1/topprod/tiptop/lib/4gl/xml_getcount.py \'",l_s,"\' ",l_x
LET lch_cmd = base.Channel.create()
CALL lch_cmd.openPipe(l_cmd,"r")
CALL lch_cmd.readline() RETURNING ls_buf
Pythone代码(注意上面调用的路径。里面有位置和保存后的文件名。这个按各位真实情况来)↓
#!/usr/bin/python
# -*- coding:utf8 -*-
###########
#获取XML内节点个数
##########
import os
import sys
import xml.etree.ElementTree as ET
s = sys.argv[1]
j = sys.argv[2]
root = ET.fromstring(s)
size = len(root.findall(j))
print(size)
转载请注明:赫非域 » TIPTOP 调用 python 用法