Questions tagged [python-cffi]

Foreign Function Interface for Python calling C code. The aim of this project is to provide a convenient and reliable way of calling C code from Python.

Foreign Function Interface for Python calling C code. The aim of this project is to provide a convenient and reliable way of calling C code from Python.

More Details

216 questions
-1
votes
1 answer

ImportError: DLL load failed while importing _fblas, when running Python from Visual Studio C# via CFFI

I'm trying to run an image processing Python script from Visual Studio C# using CFFI. I have compiled the Python script feature-extraction.py into the DLL feature-extraction.dll, which I wrap into C# code via…
Bogdan
  • 51
  • 4
-1
votes
1 answer

pip failed to install cffi w/o gcc

pip install cffi fails with error gcc: command not found in docker container on image python:3.7.4-slim This is pretty unusual and works till yesterday Of course, i can run apt install libcairo2-dev gcc, but is there any way to avoid compiling from…
Belegnar
  • 721
  • 10
  • 24
-1
votes
1 answer

Buffer protocol using CFFI

I want to expose a buffer protocol for a object, just like in this example of the Cython documentation, however I need to do this using CFFI and I wasn't able to find any examples to expose a buffer protocol.
Tarantula
  • 19,031
  • 12
  • 54
  • 71
-1
votes
1 answer

Unload DLL loaded in Python

On Windows I have a DLL that we made ourselves which among other loads another DLL. The problem is that when using the DLL in Matlab with loadlibrary, calllib and unloadlibrary everything is fine. In Python I tried to use ctypes and cffi, both with…
Jørgen
  • 853
  • 9
  • 16
-3
votes
2 answers

Clarification sought on validity and reason for "empty" C struct definition in Python CFFI definition file

I am reading some code, and came across this rather odd C struct definition: typedef struct dataObject { ...; } DATA_OBJECT; Can anyone explain (with references if possible): If this is a valid struct definition. What would be the…
Homunculus Reticulli
  • 65,167
  • 81
  • 216
  • 341
-3
votes
1 answer

cffi export python code to dll , how to read image object in @ffi.def_extern()

i am trying to convert my python code to dll using cffi so i can access this code in my c# apllication, and i am trying to send image my c# code to python function, below is my code to read the file and convert to bytes…
Rawat
  • 461
  • 3
  • 6
  • 23
1 2 3
14
15