New ScreenPanel
This commit is contained in:
21
script/pytst.py
Executable file
21
script/pytst.py
Executable file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
import sys
|
||||
import json
|
||||
script ='C:\\Users\\gobbo_a\\Dev\\pshell\\pshell\\home\\script\\np.py'
|
||||
function = 'add'
|
||||
jsonargs = '[[1, 2, 3, 4, 5], [3, 3, 3, 3, 3]]'
|
||||
args =json.loads(jsonargs)
|
||||
i = script.rfind('/')
|
||||
if i<0: i = script.rfind('\\')
|
||||
module = script[i+1:-3]
|
||||
path = script[:i+1]
|
||||
sys.path.insert(1,path)
|
||||
cmd = 'from ' + module + ' import ' + function + ' as function'
|
||||
print cmd
|
||||
exec cmd
|
||||
ret = function(*args)
|
||||
jsonret = json.dumps(ret)
|
||||
print jsonret
|
||||
"""
|
||||
|
||||
import sys;import json;script = 'C:\\Users\\gobbo_a\\Dev\\pshell\\pshell\\home\\script\\np.py';function = 'add';jsonargs = '[[1, 2, 3, 4, 5], [3, 3, 3, 3, 3]]';args =json.loads(jsonargs);i = script.rfind('\\');module = script[i+1:-3];path = script[:i+1];sys.path.insert(1,path);cmd = 'from ' + module + ' import ' + function + ' as function';exec cmd;ret = function(*args);jsonret = json.dumps(ret);print jsonret;
|
||||
Reference in New Issue
Block a user