PHP:
echo json_encode($temp);
$rtu = shell_exec("C:/Python27/python 123.py ".json_encode($temp));
Python:
import sys, json
import numpy as np
from numpy import matrix
from numpy import array
A=np.matrix(json.loads(sys.argv[1]))
print A
print ("<br/>")
M=A.I
B = np.asarray(M)
print (json.dumps(B.tolist()))
我有这个数组$temp(29x29)
,但是当我回显它的 json_encode 时,我的前 28 行打印正确(如{"0":0,"1":0,"2":0...
),但第 29 行打印为[0,0,0..]
. 此外,输出结果$rtu
为空。任何人都可以解决这个问题吗?