can python be a "shell" of c++ program?

James spiralx at gmail.com
Sat Jun 3 12:00:58 EDT 2006


Yes you can, although it might be a fair bit of work depending on the
complexity of your codebase. Basically you would need to write Python
extensions to expose your C++ classes as Python modules, using SWIG or
the Python extension code in the Boost C++ libraries. You'd then embed
an interpreter in your program which would allow you to use Python
code within it - either from a script or individual commands.

It's a fairly common use of Python :)

James

On 03/06/06, key9 <iamkey9 at 126.com> wrote:
> Hi all
>
> I have some data to process, whith complex mechanism,I put these process
> mechanism as plugins.
> and design lots of classes to abstract data themselves.
>
> but the question is how to drive them work together.
>
> That cause too much jobs: I should write UI,parser......almost a completed
> system.
>
> The problem is I don't know what these processed data will finally needed to
> display to user.
> maybe this , may be that, these can not know on design time.
>
> what I need is on outside of program,
> I can use some interface to get these data what I want , or push back data,
> or told program to recalculate it.
>
>
> can I have a way to drive c++ code use this script-like way ?
>
>
> thank you very much



More information about the Python-list mailing list