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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • key9

    #1

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

    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








  • James

    #2
    Re: can python be a "shell&quo t; of c++ program?

    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@126.co m> wrote:[color=blue]
    > 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[/color]

    Comment

    Working...