Extending Python With C

preview_player
Показать описание
An introductory video on extending python with C

Built on Fedora Linux - x86_64
Рекомендации по теме
Комментарии
Автор

This video was a great! Really gave me a better visualization on how one could interrelate the two languages and the pure efficiency of C in these test cases. Low level programming FTW!

tristanrichmond
Автор

That's a great explanation, thank you my man! Awesome <3

StefanoColucci-zw
Автор

So funny I was following your video and said "Nice" at the same time at 23:09 then "cool" right after at 23:24 😂 we're connected haha.
Extending Python with C is not that complicated and it seems fun !
I extended PostgreSQL with C to create a new data type and it was kind of the same idea except you compile the C to a shared library to which the PostgreSQL code has access.
What could also be interesting is to profile python code execution to figure out performance bottlenecks that could be mitigated with C code

kevin_menon
Автор

Seriously, why is not there a python package, that can be unleashed upon the source code of a C package and writes the boiler plate code into it for python binding?

botondkalocsai
Автор

would be interresting to see how fast the python version would be if you use something like the numba module?

Mrluk
Автор

Well it's at least importing. Returns the wrong value or crashes with "TypeError: 'builtin_function_or_method' object does not support vectorcall", but importing...

АлександрБолбат-ыу
Автор

Where does the #include <python.h> resides...

RobBominaar
Автор

Excuse me.
I wrote my code by copy yours (with a slight edition), and my "setup.py" tells me "error C2201: have external linkage in order to be exported/imported".
It is from my module initiation function:
static PyMODINIT_FUNC
{
return
};
so what might be the problem and how can I fix it?

誰でしょう-ql
Автор

Thanks for video, can you please share the source code?

thaovannguyen
Автор

Too much confusing coding and too little explanation on how to structure this interplay between C and python so that it works.
I can sort of parse it from this video but it's really a bit of a pain.
Thanks for the effort though

Dahmac
Автор

actually im more interested in the verse of this but whatever.
I basically want to be able to use python libraries without having to use python, if that makes any sense.

so im going to write a wrapper for python so i can throw it in a back corner some place and forget about it.

logangraham