Skip to content Skip to sidebar Skip to footer
Showing posts with the label C

Concurrency: Are Python Extensions Written In C/c++ Affected By The Global Interpreter Lock?

One of Python's strongest points is the ease of writing C and C++ extensions to speed up proces… Read more Concurrency: Are Python Extensions Written In C/c++ Affected By The Global Interpreter Lock?

How To Embed C Code In Python Program?

i want to write a program using multi-threading, raw sockets, to scan the ports in python i have a … Read more How To Embed C Code In Python Program?

How To Do Simple, Reliable Network Messaging?

I'm using sockets for communication between various processes right now. Everything is running … Read more How To Do Simple, Reliable Network Messaging?

Installing Bitarray In Python 2.6 On Windows

I would like to install bitarray in Windows running python 2.6. I have mingw32 installed, and I hav… Read more Installing Bitarray In Python 2.6 On Windows

Build Python Package With C Bindings In Windows (vc90) Causes Lnk1181 Fatal Error

I'm trying to build a Python package (pyspotify) with bindings to a C library (libspotify). I&#… Read more Build Python Package With C Bindings In Windows (vc90) Causes Lnk1181 Fatal Error

Value Of Py_none

It is clear to me that None is used to signify the lack of a value. But since everything must have … Read more Value Of Py_none

How Do I Convert A Python List Of Lists Of Lists Into A C Array By Using Ctypes?

As seen here How do I convert a Python list into a C array by using ctypes? this code will take a p… Read more How Do I Convert A Python List Of Lists Of Lists Into A C Array By Using Ctypes?

Python C Extension: Pyeval_getlocals() Returns Null

I need to read local variables from Python in C/C++. When I try to PyEval_GetLocals, I get a NULL. … Read more Python C Extension: Pyeval_getlocals() Returns Null

Embedding Matplotlib In C

I have a double pointer in C, and I want to plot it with matplotlib from C. I'm not understandi… Read more Embedding Matplotlib In C

Calling Mpi Binary In Serial As Subprocess Of Mpi Application

I have a large parallel (using MPI) simulation application which produces large amounts of data. In… Read more Calling Mpi Binary In Serial As Subprocess Of Mpi Application

Buffers And Memoryview Objects Explained For The Non-c Programmer

Python 2.7 has introduced a new API for buffers and memoryview objects. I read the documentation on… Read more Buffers And Memoryview Objects Explained For The Non-c Programmer

How To Register A Destructor For A C-allocated Numpy Array?

I want to allocate numbers for a numpy array in C/C++, and pass them to python as a numpy array. Th… Read more How To Register A Destructor For A C-allocated Numpy Array?

How Do I Use The Correct Dll Files To Enable 3rd Party C Libraries In A Cython C Extension?

I have a C function that involves decompressing data using zstd. I am attempting to call that funct… Read more How Do I Use The Correct Dll Files To Enable 3rd Party C Libraries In A Cython C Extension?

Running C In A Browser

I've spent days of research over the seemingly simple question: is it possible to run C code in… Read more Running C In A Browser

Renamed .c Files To .cpp, Importing Cython Library Fails

I had a working Cython program which wrapped some C libraries and custom C code. Recently, I had to… Read more Renamed .c Files To .cpp, Importing Cython Library Fails

Detecting When A Gtk Window Is Done Moving/resizing By The User

I want to detect when the user finished re-sizing or moving the GTK window. Basically an equivalent… Read more Detecting When A Gtk Window Is Done Moving/resizing By The User

Python C-api Object Allocation

I want to use the new and delete operators for creating and destroying my objects. The problem is p… Read more Python C-api Object Allocation

How Would One Implement Lazy Evaluation In C?

Take for example, The follow python code: def multiples_of_2(): i = 0 while True: i = i + 2… Read more How Would One Implement Lazy Evaluation In C?

Python C Api Crashes On 'import Numpy' When Initilizing Multiple Times

While working with the Python C API, I found that the python interpreter crashes when initializing … Read more Python C Api Crashes On 'import Numpy' When Initilizing Multiple Times

Access C_char_p_array_256 In Python Using Ctypes

I have a native python bridge to some C code, which returns a pointer to an array (array of structs… Read more Access C_char_p_array_256 In Python Using Ctypes