Embedding python in C

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Philippe C. Martin

    Embedding python in C

    Hi,

    Is there a program out there that would generate the C code to instantiate
    objects and call them:

    ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?

    I seem to recall a _yes_ to that but I got a memory overflow :-)

    Thanks,

    Philippe
  • Philippe C. Martin

    #2
    Re: Embedding python in C - newbie

    Just to make sure i'm clear as I've been told about swig and pyrex: I don't
    want to eventually have a python script call C modules, but rather a main.c
    make calls to python functionnalitie s.

    I did add newbie in the title :-)

    Regards,

    Philippe



    Philippe C. Martin wrote:
    [color=blue]
    > Hi,
    >
    > Is there a program out there that would generate the C code to instantiate
    > objects and call them:
    >
    > ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?
    >
    > I seem to recall a _yes_ to that but I got a memory overflow :-)
    >
    > Thanks,
    >
    > Philippe[/color]

    Comment

    • Philippe C. Martin

      #3
      Re: Embedding python in C - newbie

      Sorry, it is still not clear when I reread it:

      1) I have a bunch of Python working modules
      2) I need to compile "something" so external C applications can access 1)

      Thanks,

      Philippe



      Philippe C. Martin wrote:
      [color=blue]
      > Just to make sure i'm clear as I've been told about swig and pyrex: I
      > don't want to eventually have a python script call C modules, but rather a
      > main.c make calls to python functionnalitie s.
      >
      > I did add newbie in the title :-)
      >
      > Regards,
      >
      > Philippe
      >
      >
      >
      > Philippe C. Martin wrote:
      >[color=green]
      >> Hi,
      >>
      >> Is there a program out there that would generate the C code to
      >> instantiate objects and call them:
      >>
      >> ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?
      >>
      >> I seem to recall a _yes_ to that but I got a memory overflow :-)
      >>
      >> Thanks,
      >>
      >> Philippe[/color][/color]

      Comment

      • Chris Lambacher

        #4
        Re: Embedding python in C

        pyrex can be used for embedding too.


        On 6/28/05, Philippe C. Martin <philippecmarti n@sbcglobal.net > wrote:[color=blue]
        > Actually maybe not ... looking at the doc:
        >
        > I have modules already coded in Python, and I need a C wrapper so C
        > applications may link with it.
        >
        > Regards,
        >
        > Philippe
        >
        >
        >
        > On Tuesday 28 June 2005 04:53 pm, Philippe C. Martin wrote:[color=green]
        > > Sounds like it, thanks.
        > >
        > > Philippe
        > >
        > > On Tuesday 28 June 2005 09:10 pm, Chris Lambacher wrote:[color=darkred]
        > > > Pyrex might be what you are looking for:
        > > > http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
        > > >
        > > > -Chris
        > > >
        > > > On 6/28/05, Philippe C. Martin <philippe@phili ppecmartin.com> wrote:
        > > > > Hi,
        > > > >
        > > > > Is there a program out there that would generate the C code to
        > > > > instantiate objects and call them:
        > > > >
        > > > > ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?
        > > > >
        > > > > I seem to recall a _yes_ to that but I got a memory overflow :-)
        > > > >
        > > > > Thanks,
        > > > >
        > > > > Philippe
        > > > > --
        > > > > http://mail.python.org/mailman/listinfo/python-list[/color][/color]
        >
        > --
        > *************** *************** *******
        > Philippe C. Martin
        > SnakeCard, LLC
        > www.snakecard.com
        > +1 405 694 8098
        > *************** *************** *******
        > [/color]


        --
        Christopher Lambacher
        lambacck@comput er.org

        Comment

        • Philippe C. Martin

          #5
          Re: Embedding python in C

          Thanks, I cannot get the demo to compile, but I joined their list.

          Thanks

          Philippe



          Chris Lambacher wrote:
          [color=blue]
          > pyrex can be used for embedding too.
          > http://www.freenet.org.nz/python/embeddingpyrex/
          >
          > On 6/28/05, Philippe C. Martin <philippecmarti n@sbcglobal.net > wrote:[color=green]
          >> Actually maybe not ... looking at the doc:
          >>
          >> I have modules already coded in Python, and I need a C wrapper so C
          >> applications may link with it.
          >>
          >> Regards,
          >>
          >> Philippe
          >>
          >>
          >>
          >> On Tuesday 28 June 2005 04:53 pm, Philippe C. Martin wrote:[color=darkred]
          >> > Sounds like it, thanks.
          >> >
          >> > Philippe
          >> >
          >> > On Tuesday 28 June 2005 09:10 pm, Chris Lambacher wrote:
          >> > > Pyrex might be what you are looking for:
          >> > > http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
          >> > >
          >> > > -Chris
          >> > >
          >> > > On 6/28/05, Philippe C. Martin <philippe@phili ppecmartin.com> wrote:
          >> > > > Hi,
          >> > > >
          >> > > > Is there a program out there that would generate the C code to
          >> > > > instantiate objects and call them:
          >> > > >
          >> > > > ex: miracle.exe -i mymodule.py -o module_internfa ce.c ?
          >> > > >
          >> > > > I seem to recall a _yes_ to that but I got a memory overflow :-)
          >> > > >
          >> > > > Thanks,
          >> > > >
          >> > > > Philippe
          >> > > > --
          >> > > > http://mail.python.org/mailman/listinfo/python-list[/color]
          >>
          >> --
          >> *************** *************** *******
          >> Philippe C. Martin
          >> SnakeCard, LLC
          >> www.snakecard.com
          >> +1 405 694 8098
          >> *************** *************** *******
          >>[/color]
          >
          >[/color]

          Comment

          Working...