Re: How to call and execute C code in Python?

2012-05-16 Thread Barry Scott
There are many choices rather then raw python C API calls. Boost, PyCXX and ctypes are worth investigating. PyCXX requires you code in C++ but hides lots of the issues of using the Python API from you. It also supports python 2 and 3. Barry - PyCXX maintainer -- http://mail.python.org/mailma

Re: How to call and execute C code in Python?

2012-05-15 Thread Chris Angelico
On Tue, May 15, 2012 at 10:08 PM, David Shi wrote: > How to call and execute C code in Python? > > Is there any publication/documentation for this?   For the worst scenario, > how many ways are there to call and execute C codes, in Python. > > For instance, having got

How to call and execute C code in Python?

2012-05-15 Thread David Shi
How to call and execute C code in Python? Is there any publication/documentation for this?   For the worst scenario, how many ways are there to call and execute C codes, in Python. For instance, having got hold some C codes, attempting to use Python to call and execute C codes.  I.e.  Python

Re: How to call and execute C code in Python?

2012-05-14 Thread Chris Angelico
On Tue, May 15, 2012 at 12:36 AM, Michael Torrie wrote: > On 05/13/2012 11:27 AM, Mark Lawrence wrote: >> Stefan, you appear to have a lot to do with Cython. It would be polite >> to mention this when replying. > > Why?  Do you think this is some sort of weird conflict of interest?  As > anyone wh

Re: How to call and execute C code in Python?

2012-05-14 Thread Michael Torrie
On 05/13/2012 11:27 AM, Mark Lawrence wrote: > Stefan, you appear to have a lot to do with Cython. It would be polite > to mention this when replying. > Why? Do you think this is some sort of weird conflict of interest? As anyone who follows this list for several years would know, Cython is a

Re: How to call and execute C code in Python?

2012-05-13 Thread Stefan Behnel
Devin Jeanpierre, 14.05.2012 01:19: > Now if only my editor would bold those "cdef"s... :) Cython syntax support in editors is definitely not ubiquitous, but it's getting more and more widespread, so you may be lucky at some point (or find a way to add it yourself). Pygments also does a pretty goo

Re: How to call and execute C code in Python?

2012-05-13 Thread Devin Jeanpierre
On Sun, May 13, 2012 at 11:58 AM, Stefan Behnel wrote: > David Shi, 13.05.2012 15:25: >> Can anyone tell me how to call and exectute C code in Python? > > Take a look at Cython, a Python-like language that supports native calls to > and from C/C++ code. It translates your code into very efficient

Re: How to call and execute C code in Python?

2012-05-13 Thread Chris Angelico
On Mon, May 14, 2012 at 3:23 AM, Mark Lawrence wrote: > On 13/05/2012 16:39, Chris Angelico wrote: >> >> On Sun, May 13, 2012 at 11:25 PM, David Shi  wrote: >>> >>> Can anyone tell me how to call and exectute C code in Python? >> >> >> Browse the documentation about Extending and Embedding Python,

Re: How to call and execute C code in Python?

2012-05-13 Thread Terry Reedy
On 5/13/2012 9:25 AM, David Shi wrote: Can anyone tell me how to call and exectute C code in Python? Regards. David *From:* "python-list-requ...@python.org" *To:* python-list@python.org *Sent:* Friday, 11 May 2012, 5:35

Re: How to call and execute C code in Python?

2012-05-13 Thread Stefan Behnel
Mark Lawrence, 13.05.2012 20:25: > My response to Chris Angelico was simple and > you've gone off at a complete tangent whilst writing "War and Peace". Or is > it a simple matter that my newsreader is better than your newsreader? Ah, sorry. I didn't know we were discussing at *that* level. Stefan

Re: How to call and execute C code in Python?

2012-05-13 Thread Mark Lawrence
On 13/05/2012 19:14, Stefan Behnel wrote: Mark Lawrence, 13.05.2012 19:44: On 13/05/2012 18:38, Stefan Behnel wrote: Mark Lawrence, 13.05.2012 19:23: On 13/05/2012 16:39, Chris Angelico wrote: On Sun, May 13, 2012 at 11:25 PM, David Shi wrote: Can anyone tell me how to call and exectute C co

Re: How to call and execute C code in Python?

2012-05-13 Thread Stefan Behnel
Mark Lawrence, 13.05.2012 19:44: > On 13/05/2012 18:38, Stefan Behnel wrote: >> Mark Lawrence, 13.05.2012 19:23: >>> On 13/05/2012 16:39, Chris Angelico wrote: On Sun, May 13, 2012 at 11:25 PM, David Shi wrote: > Can anyone tell me how to call and exectute C code in Python? Brows

Re: How to call and execute C code in Python?

2012-05-13 Thread Mark Lawrence
On 13/05/2012 18:38, Stefan Behnel wrote: Mark Lawrence, 13.05.2012 19:23: On 13/05/2012 16:39, Chris Angelico wrote: On Sun, May 13, 2012 at 11:25 PM, David Shi wrote: Can anyone tell me how to call and exectute C code in Python? Browse the documentation about Extending and Embedding Python

Re: How to call and execute C code in Python?

2012-05-13 Thread Stefan Behnel
Mark Lawrence, 13.05.2012 19:27: > On 13/05/2012 16:58, Stefan Behnel wrote: >> David Shi, 13.05.2012 15:25: >>> Can anyone tell me how to call and exectute C code in Python? >> >> Take a look at Cython, a Python-like language that supports native calls to >> and from C/C++ code. It translates your

Re: How to call and execute C code in Python?

2012-05-13 Thread Stefan Behnel
Mark Lawrence, 13.05.2012 19:23: > On 13/05/2012 16:39, Chris Angelico wrote: >> On Sun, May 13, 2012 at 11:25 PM, David Shi wrote: >>> Can anyone tell me how to call and exectute C code in Python? >> >> Browse the documentation about Extending and Embedding Python, there's >> an extensive API. >

Re: How to call and execute C code in Python?

2012-05-13 Thread Mark Lawrence
On 13/05/2012 16:58, Stefan Behnel wrote: David Shi, 13.05.2012 15:25: Can anyone tell me how to call and exectute C code in Python? Take a look at Cython, a Python-like language that supports native calls to and from C/C++ code. It translates your code into very efficient C code, so the wrapp

Re: How to call and execute C code in Python?

2012-05-13 Thread Mark Lawrence
On 13/05/2012 16:39, Chris Angelico wrote: On Sun, May 13, 2012 at 11:25 PM, David Shi wrote: Can anyone tell me how to call and exectute C code in Python? Browse the documentation about Extending and Embedding Python, there's an extensive API. Chris Angelico I like your response, my first

Re: How to call and execute C code in Python?

2012-05-13 Thread Stefan Behnel
David Shi, 13.05.2012 15:25: > Can anyone tell me how to call and exectute C code in Python? Take a look at Cython, a Python-like language that supports native calls to and from C/C++ code. It translates your code into very efficient C code, so the wrapping code tends to be very fast (often faster

Re: How to call and execute C code in Python?

2012-05-13 Thread Chris Angelico
On Sun, May 13, 2012 at 11:25 PM, David Shi wrote: > Can anyone tell me how to call and exectute C code in Python? Browse the documentation about Extending and Embedding Python, there's an extensive API. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

How to call and execute C code in Python?

2012-05-13 Thread David Shi
Can anyone tell me how to call and exectute C code in Python? Regards. David From: "python-list-requ...@python.org" To: python-list@python.org Sent: Friday, 11 May 2012, 5:35 Subject: Python-list Digest, Vol 104, Issue 57 - Forwarded Message - Sen