Writing Extensions for Python 3 in C

A

Aditya Avinash

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.
 
U

Ulrich Eckhardt

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
 
R

rusi

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top