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

Annotation of OpenXM/src/ox_python/assert1.rr, Revision 1.3

1.2       takayama    1: pari(nextprime,10)$
                      2: if (Pid == 0) {
                      3:   Pid=ox_launch(0,getenv("OpenXM_HOME")+"/src/ox_python/ox_python")$
                      4: }else{}$
1.3     ! takayama    5: ox_execute_string(Pid,"from time import time,ctime\nprint('Today is',ctime(time()))\n")$  // It is executed by PyRun_SimpleString()
1.2       takayama    6: printf("result of ox_execute_string = %a, see also server window\n",ox_pop_cmo(Pid))$
                      7: ox_cmo_rpc(Pid,"PyRun_String","str(eval('1+2'))")$
                      8: printf("result of PyRun_String str(eval('1+2')) = %a\n",ox_pop_cmo(Pid))$
                      9: ox_cmo_rpc(Pid,"PyRun_String","print('Hello')")$
                     10: printf("result of PyRun_String print('Hello')= %a\n",ox_pop_cmo(Pid))$
                     11: ox_cmo_rpc(Pid,"PyRun_String","1+2")$
                     12: printf("result of PyRun_String 1+2= %a\n",ox_pop_cmo(Pid))$
                     13: ox_cmo_rpc(Pid,"eval","1+2")$
                     14: printf("result of eval 1+2= %a\n",ox_pop_cmo(Pid))$
1.3     ! takayama   15:
        !            16: ox_cmo_rpc(Pid,"PyRun_String","str(eval('1+2'))")$
        !            17: printf("result type of PyRun_String str(eval('1+2')) = %a\n",type(ox_pop_cmo(Pid)))$
        !            18: ox_cmo_rpc(Pid,"PyRun_String","print('Hello')")$
        !            19: printf("result type of PyRun_String print('Hello')= %a\n",type(ox_pop_cmo(Pid)))$
        !            20: ox_cmo_rpc(Pid,"PyRun_String","1+2")$
        !            21: printf("result type of PyRun_String 1+2= %a\n",type(ox_pop_cmo(Pid)))$
        !            22: ox_cmo_rpc(Pid,"eval","1+2")$
        !            23: printf("result type of eval 1+2= %a\n",type(ox_pop_cmo(Pid)))$
        !            24: printf("where type=7 string, type=10 int32\n");
1.1       takayama   25: end$
                     26:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>