Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #48693 > unrolled thread

Writing Extensions for Python 3 in C

Started byAditya Avinash <adityaavinash143@gmail.com>
First post2013-06-18 15:54 +0530
Last post2013-06-19 10:11 -0700
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Writing Extensions for Python 3 in C Aditya Avinash <adityaavinash143@gmail.com> - 2013-06-18 15:54 +0530
    Re: Writing Extensions for Python 3 in C Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2013-06-19 10:48 +0200
    Re: Writing Extensions for Python 3 in C rusi <rustompmody@gmail.com> - 2013-06-19 10:11 -0700

#48693 — Writing Extensions for Python 3 in C

FromAditya Avinash <adityaavinash143@gmail.com>
Date2013-06-18 15:54 +0530
SubjectWriting Extensions for Python 3 in C
Message-ID<mailman.3572.1371627851.3114.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

Hi. This is the last place where I want to ask a question. I have searched
for lots of tutorials and documentation on the web but, didn't find a
decent one to develop extensions for Python 3 using a custom compiler
(mingw32, nvcc). Please help me.
PS: Don't point me to Python Documentation. It is not good for beginners.
It doesn't elaborate about calls and implementation.

-- 
Aditya Avinash Atluri

[toc] | [next] | [standalone]


#48703

FromUlrich Eckhardt <ulrich.eckhardt@dominolaser.com>
Date2013-06-19 10:48 +0200
Message-ID<rr789a-fn8.ln1@satorlaser.homedns.org>
In reply to#48693
Am 18.06.2013 12:24, schrieb Aditya Avinash:
> Hi. This is the last place where I want to ask a question.

You are probably not saying what you mean here. The meaning of your 
sentence is more like "Here is the forum that I dislike more than any 
other forum, but still I have to ask a question here (even though I 
don't like you)." :^)


> I have searched for lots of tutorials and documentation on the web but,
 > didn't find a decent one to develop extensions for Python 3 using a
 > custom compiler (mingw32, nvcc).

There is even a tutorial here:

http://docs.python.org/3/extending/index.html

Have you tried that yet? Doing it with a different compiler is something 
I would save for a second step. Maybe if you described your problems 
with a bit more detail would help.


Uli

[toc] | [prev] | [next] | [standalone]


#48735

Fromrusi <rustompmody@gmail.com>
Date2013-06-19 10:11 -0700
Message-ID<11983dd7-1ff7-4897-b1de-930bd6e74dc3@v5g2000pbv.googlegroups.com>
In reply to#48693
On Jun 18, 3:24 pm, Aditya Avinash <adityaavinash...@gmail.com> wrote:
> Hi. This is the last place where I want to ask a question. I have searched
> for lots of tutorials and documentation on the web but, didn't find a
> decent one to develop extensions for Python 3 using a custom compiler
> (mingw32, nvcc). Please help me.
> PS: Don't point me to Python Documentation. It is not good for beginners.
> It doesn't elaborate about calls and implementation.

You need to tell what youve read, what youve tried, where stuck.
Yes the extending and embedding stuff http://docs.python.org/2/extending/
and
http://docs.python.org/2/c-api/index.html is more difficult than much
other than other python docs.

That is intrinsic to the problem -- you are not in the python world
but the C world and C is a much harder and headachey-er than python.
And building the python infrastructure on top of that is still harder.

If you have to use it, you really need to get the data-structure
invariants right: eg http://docs.python.org/2/c-api/intro.html#objects-types-and-reference-counts.

However as Terry suggests, using something like Cython to avoid this
should always be first explored.  Heres a list

1. 'Classic' extending/embedding
2. SCXX
3. PyCXX
4. Boost
5. Ctypes
6. Swig
7. Sip
8. cython

Explore in reverse order!

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web