[BACK]Return to test2.rr CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_python / Test

File: [local] / OpenXM / src / ox_python / Test / test2.rr (download)

Revision 1.1, Sun Jan 2 02:54:00 2022 UTC (2 years, 4 months ago) by takayama
Branch: MAIN
CVS Tags: HEAD

Bug of a big string.  python.execute_by_file(Cmd1,Cmd_to_get_a_value)
Example: python.execute_by_file(["import numpy as np","A=[[1,1],[2,3]]"],"np.linalg.matrix_rank(A)");

pari(nextprime,2)$  Pid=0$ // assume the server id of ox_pari is 0
//load("python.rr")$ Pid=python.start()$
//Pid=ox_launch(0,"ox_asir")$
ox_push_cmo(Pid,"Hello")$
ox_pop_cmo(Pid);
Size=7309676$
//Size=1024*10$
A=newvect(Size)$
for (I=0; I<Size; I++) A[I]=0x41;
A=vtol(A)$
ox_push_cmo(Pid,99)$
ox_push_cmo(Pid,asciitostr(A))$
printf("ox_push_cmo(string) is Done.\n")$
B=ox_pop_cmo(Pid)$
printf("B=ox_pop_cmo(); Done. type(B)=%a\n",type(B))$
length(strtoascii(B));
ox_pop_cmo(Pid)$ // pop 99
end$