By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

Embedding python in C

P: n/a
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_internface.c ?

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

Thanks,

Philippe
Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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 functionnalities.

I did add newbie in the title :-)

Regards,

Philippe

Philippe C. Martin 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_internface.c ?

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

Thanks,

Philippe


Jul 19 '05 #2

P: n/a
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:
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 functionnalities.

I did add newbie in the title :-)

Regards,

Philippe

Philippe C. Martin 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_internface.c ?

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

Thanks,

Philippe


Jul 19 '05 #3

P: n/a
pyrex can be used for embedding too.
http://www.freenet.org.nz/python/embeddingpyrex/

On 6/28/05, Philippe C. Martin <ph*************@sbcglobal.net> wrote:
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:
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 <ph******@philippecmartin.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_internface.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


--
*************************************
Philippe C. Martin
SnakeCard, LLC
www.snakecard.com
+1 405 694 8098
*************************************

--
Christopher Lambacher
la******@computer.org
Jul 19 '05 #4

P: n/a
Thanks, I cannot get the demo to compile, but I joined their list.

Thanks

Philippe

Chris Lambacher wrote:
pyrex can be used for embedding too.
http://www.freenet.org.nz/python/embeddingpyrex/

On 6/28/05, Philippe C. Martin <ph*************@sbcglobal.net> wrote:
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:
> 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 <ph******@philippecmartin.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_internface.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


--
*************************************
Philippe C. Martin
SnakeCard, LLC
www.snakecard.com
+1 405 694 8098
*************************************



Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.