Stefan Behnel wrote: > Stefan Behnel wrote: >> Harald Schilly wrote: >>> On Tue, Oct 6, 2009 at 11:14, Stefan Behnel wrote: >>>> Do you want to link your C code into a Python module, or rather embed the >>>> CPython Interpreter in a C program and use your Cython module there? >>> hello, thanks for the answers so far. What I want to do is to call a >>> Python program from an existing C program. >> Look at the Demos/embed directory in the Cython source distribution. > > ... although that won't tell you how to access the public C-API of a module > from C code when the module is imported by an embedded CPython runtime.
... think twice before you post. I guess you don't even have to use a public C-API here. It should be enough to use the embedding code and link the Python module directly into your C binary. Then, after initialising the interpreter and calling the module init function, you should be able to call the exported "public" functions of your Cython module directly. But as I said, I never tested that. Would make a nice extension to the Demos/embed example, though. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
