Is there a better way to make a call from C than
PyRun_SimpleStr ing("import
foo_in_python\n foo_in_python.b ar(whatever)\n" );
?
I already imported the foo_in_python using PyImport_Import Module
and wonder why do I need to keep importing it every time I'm
calling a python function in that module.
I stepped thru PyImport_Import Module and it seems rather expensive.
I assume the module will end up in cache after PyImport_Import Module
so that subsequent
PyRun_SimpleStr ing("import foo_in_python\n ...
is cheaper but I still have to wonder if I what I'm doing is the right
thing or there is a much simpler way of doing this.
Does anyone know why does the import tries to load .py files before
..pyc?
Thank you.
PyRun_SimpleStr ing("import
foo_in_python\n foo_in_python.b ar(whatever)\n" );
?
I already imported the foo_in_python using PyImport_Import Module
and wonder why do I need to keep importing it every time I'm
calling a python function in that module.
I stepped thru PyImport_Import Module and it seems rather expensive.
I assume the module will end up in cache after PyImport_Import Module
so that subsequent
PyRun_SimpleStr ing("import foo_in_python\n ...
is cheaper but I still have to wonder if I what I'm doing is the right
thing or there is a much simpler way of doing this.
Does anyone know why does the import tries to load .py files before
..pyc?
Thank you.
Comment