From: wware-nospam at world.std.com (Will Ware)
Date: Wed, 28 Apr 1999 04:13:23 GMT
Subject: Python and C
References: <37243B44.AE6231AE@serop.abb.se> <7g5bom$g4n$1@Starbase.NeoSoft.COM>
Message-ID: <FAvt2B.6A4@world.std.com>
Content-Length: 1163
X-UID: 1665                                                  

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




