two embedded problem. one maybe is python bug.

2006-08-03 Thread yy x
hi,all,       the content of a.py : #coding:gb2312#/usr/local/bin/pythonimport randomprint random.randint(0,10)   the c program: #include int main(){    Py_Initialize();    PyRun_SimpleString("import sys");    PyRun_SimpleString("sys.path.append('.')");     PyRun_SimpleString("impo

how to transfer a python object to other computer?

2006-04-19 Thread yy x
    Hey, all.Now I wanna to transfer a object to other computer, Maybe I could serialize the object to a file by pickle moudle, then send the file and get it from the file.But I think the efficency is awful, because the disk io is very slow. Someone could do me a favor to give me some idea?

How to call a mothod in a class by the method name string and the instance?

2006-02-15 Thread yy x
hi, all:   for example, the following class: class test:    def funca(self):    print  "in funca"     def funcb(self):    print  "in funcb" t = test() t.funca()       In the plain way,  i will excute the funca by the code "t.funca() ", but if i wanna to excute the funca by "t" and string "f

The question in source code about of funciton--PyObject_CallFunction (in file abstract.c)

2006-01-22 Thread yy x
hi,all.  I have remarked the statement of question with blue color in the following funcition, Counld someone answer me?   thanks       PyObject *PyObject_CallFunction(PyObject *callable, char *format, ...){ va_list va; PyObject *args, *retval;  if (callable == NULL)  return null_error();  if (form