ctypes
Pixel manipulation with PIL.Image and ctypes
I have a C function that does some pixel manipulation on a raw 2D array of 8 bit RGB values. I get the response in 开发者_StackOverflowa c_ubyte array. My code looks roughly like this:[详细]
2023-03-13 13:54 分类:问答Python ctypes: WindowsError when using function pointer
I\'m trying to use Python\'s ctypes to work with a DLL, but I occasionally run into a problem when I try to call a function that\'s passed as a pointer to another function.[详细]
2023-03-12 08:15 分类:问答Python ctypes: How do I flush output from stderr?
I\'ve written some function callbacks using python\'s ctypes to access functions in a DLL.The code used to build that DLL has some debugging print statements in it using fprintf to stderr.However, whe[详细]
2023-03-12 00:41 分类:问答Prevent automatic type conversion in ctypes callback functions
When wrapping Python functions with a CFUNCTYPE type, I\'ve found that the non-pointer types are automatically converted as though their value attribute was called.[详细]
2023-03-11 14:00 分类:问答How to manage string memory with python ctypes
My python code is calling a C function in a native library (also written by me). The function takes two strings as arguments and returns its response as a string. The two argument strings that python[详细]
2023-03-11 09:20 分类:问答Mapping basic typedef aliases with ctypes?
I understand how to define structs in Python with ctypes, but I can\'t seem to find any documentation on how to handle basic aliases. For example 64-bit integers in SQLite:[详细]
2023-03-10 23:10 分类:问答Python: ctypes + C malloc error. C memory problem or Python/ctypes problem?
everyone.I\'m having a memory allocation error using ctypes and a C code.I\'m wondering if the memory problem is inside of C, or caused by an improper use of ctypes. The memory error is[详细]
2023-03-10 10:59 分类:问答Calling uname from libc with Pythons ctypes
tl;dr this works with the GNU version of libc (haven\'t tried it with uclibc yet) from ctypes import *[详细]
2023-03-10 06:04 分类:问答Path-independant management of shared C libs inside a Python package
Say I have a package called Foo organized this way: Foo\\ __init__.py foo.py bar.py lib\\ libwhatever.so My module foo.py uses python ctypes to wrap the C-methods contained in my libwhatever.lib, w[详细]
2023-03-09 18:19 分类:问答ctypes invalid result type for a callback function
I face a problem while implementing with ctypes. I have 2 C functions: antichain** decompose_antichain(antichain*, int, char (*)(void*, void*), void** (*)(void*));[详细]
2023-03-09 14:16 分类:问答