python as plugin language
John Roth
johnroth at ameritech.net
Mon Jul 2 12:00:03 EDT 2001
"Alex Martelli" <aleaxit at yahoo.com> wrote in message
news:9hhkpq010gl at enews2.newsguy.com...
> "John Roth" <johnroth at ameritech.net> wrote in message
> news:tjiok16g2asmc7 at news.supernews.com...
> ...
> > All the cases you cite miss the essential point - how does the Python
> > code call a function in the C language program it's embedded in? It's
> ...
> > I think the functions I need are in the Python/C API, but I've never
seen
> > those functions referenced in any example, or in any of the books.
>
> I may be missing something, but... doesn't the embed.c demo/example,
> D:\Python-2.1\Demo\embed\demo.c on a typical Python install on Win32
> for ex., do exactly what you require...? Well, almost -- it doesn't
> actually run any useful Python code, just leave a space where you
> could insert your own:-). But it does show the embedding C program
> adding a module, called "xyzzy", which exposes to Python a C function,
> called "foo" (from the Python side of things). Your Python code
> invoked from demo.c could "import xyzzy" and then call xyzzy.foo().
>
> So, WHAT am I missing...?
The fact that my C:\Python21 directory doesn't contain any directory
named "Demo"? Where do I get it? It wasn't in my "typical" Win32
installation.
John Roth
>
>
> Alex
>
>
>
More information about the Python-list
mailing list