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
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?
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
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
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
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
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 i
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
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
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
code in Python?
Browse the documentation about Extending and Embedding Python, there's
an extensive API.
I like your response, my first thought was to say "yes" :)
It has a serious learning curve all by itself, though, with a lot of major
pitfalls not only for new users. It
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
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
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
>>
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 Pytho
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
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 respons
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 (of
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
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
- Forward
On Jul 10, 5:05 am, Bruno Desthuilliers wrote:
> Mmm... We can't tell for sure since we have no use case, but I'm not
> sure that the OP wants an immutable object here.
>
> > or an `array.array`.
>
> or a StringIO.
>
> > And is `BLOCK`
> > really just a structure with *one* member? Looks a bit o
Marc 'BlackJack' Rintsch a écrit :
> On Fri, 06 Jul 2007 17:31:50 +, DeveloperX wrote:
>
>> I am trying to figure out how to rewrite the following chunk of code
>> in Python:
>>
>> C source
>> [code]
>> typedef struct PF
>> {
>> int flags;
>> long user;
>> char*filename;
>> unsigned ch
how would MAXBUFFERSIZE be taken care in python;
--abhi
On 7/7/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
On Fri, 06 Jul 2007 17:31:50 +, DeveloperX wrote:
> Python Attempt: Please note that since I can't type TABs online
> easily, I am using the @ character to represent TABs in the f
On Fri, 06 Jul 2007 17:31:50 +, DeveloperX wrote:
> Python Attempt: Please note that since I can't type TABs online
> easily, I am using the @ character to represent TABs in the following
> Python code.
Why not indent with spaces, just like you did for the example C code?
--
Steven.
--
On Fri, 06 Jul 2007 17:31:50 +, DeveloperX wrote:
> I am trying to figure out how to rewrite the following chunk of code
> in Python:
>
> C source
> [code]
> typedef struct PF
> {
> int flags;
> long user;
> char*filename;
> unsigned char buffer[MAXBUFFERSIZE];
> } PF;
>
> typedef BL
I am trying to figure out how to rewrite the following chunk of code
in Python:
C source
[code]
typedef struct PF
{
int flags;
long user;
char*filename;
unsigned char buffer[MAXBUFFERSIZE];
} PF;
typedef BLOCK
{
PF * packdata;
} BLOCK;
BLOCK* blocks;
[/code]
My first idea was to creat
Tommy Grav wrote:
> I have some numerical code in C that I would like to call from Python. Can
> anyone point me in a direction for some text I could read on how to do this?
It somewhat depends on the kind of numerical code and the interface it exposes.
Do you need to pass arrays back and forth?
I have some numerical code in C that I would like to call from Python. Cananyone point me in a direction for some text I could read on how to do this?Cheers Tommy[EMAIL PROTECTED]http://homepage.mac.com/tgrav/"Any intelligent fool can make things bigger, more complex, and more violent. It takes a t
28 matches
Mail list logo