Python and C

Will Ware wware-nospam at world.std.com
Wed Apr 28 00:13:23 EDT 1999


In article <37243B44.AE6231AE at serop.abb.se>, thstr  <thstr at serop.abb.se> wrote:
>I would like to add some kind of command interpreter to which you can
>type commands like "test  functionA(arg1, arg2, ...)"...
>For some reasons I'd like this interpreter in Python (like a static
>module), linked with C at compile time, is this possible?? 

Some resources for this:

Go to www.python.org and look under "Documentation", somewhere there
is a tutorial on embedding and extending the Python interpreter. This
describes how to write a C/Python interface. Doing this by hand is a
bit daunting, consider Swig (mentioned below).

Look for the book "Programming Python" (author Mark Lutz, publisher
O'Reilly). This book may appear a little imposing but it has a lot
of good information, including writing C interfaces.

Go to www.swig.org, which is about a program called Swig which will
automatically generate C/Python interface code from a very simple
description of your C functions.
-- 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Will Ware		email: wware[at]world[dot]std[dot]com
PGP fp (new key 07/15/97) 67683AE2 173FE781 A0D99636 0EAE6117




More information about the Python-list mailing list