<[EMAIL PROTECTED]> escribió en el mensaje 
news:[EMAIL PROTECTED]

> Is there a better way to make a call from C than
>
> PyRun_SimpleString("import
> foo_in_python\nfoo_in_python.bar(whatever)\n");
>
> I already imported the foo_in_python using PyImport_ImportModule
> and wonder why do I need to keep importing it every time I'm
> calling a python function in that module.

Sure. Use the reference to the module that you got from 
PyImport_ImportModule; you call a method using PyObject_CallMethod or 
similar.

> Does anyone know why does the import tries to load .py files before
> .pyc?
It has to be sure that the .pyc is up-to-date; the .pyc contains a magic 
number and the modification time of the corresponding .py

-- 
Gabriel Genellina 


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to