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

K

key9

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



key9
 
J

James

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,297
Messages
2,571,536
Members
48,284
Latest member
alphabetsalphabets

Latest Threads

Top