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()))
I have this array $temp(29x29)
but when I echo its json_encode my first 28 rows are printed correctly (as in {"0":0,"1":0,"2":0...
) but the 29th row is printed as [0,0,0..]
. Moreover the output $rtu
is coming out to be null. Can anyone fix that?