[Pyrex] Can pyrex codes call python objects/methods such as String, re, datetime, os diretively

liangxing liangxing at made-in-china.com
Mon Jul 2 02:59:27 UTC 2007



As I have found out, a function can be defined as Python-func or C-func. With Python-functions, the return value and parameters can be regarded as a general python object. It is true.

But I still hava one puzzle in "interfacing with a existing python object". Could I take such mearsures in order to utilizes Python built-in Method as follows:

---------myprex_prog.pyx---------
import sys
import datetime
import cx_Oracle
include "Python.h"
.....

print sys.path
...
datatime.datetime.now()
....
conn = cx_Oracle.connection()
...
-----------------------------------------

My case is retrieveling all record items from a Oracle Database, within a loop execution. By calling cursor.fetchmany() multi-times, I found it is quite slow. I am planing to reimplement this program in Pyrex.
But I wonder is it possible to have a python object/method called in Pyrex program.
ths in advance, buddy.


More information about the Pyrex mailing list