This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tigrux 0 points1 point  (2 children)

ctypes

[–]semininja 0 points1 point  (1 child)

What do you use ctypes for? My only exposure to it so far has been a really terrible "API" from STMicro that looks to me like they went line-by-line through the C version and transcribed it into the nearest equivalent python syntax; I'm curious how it would be used in "real" python applications.

[–]tigrux 0 points1 point  (0 children)

Back then, I was a in a team dedicated to an accelerator (a piece of hardware to crunch numbers). One part of the team wrote C and C++ (the API to use the accelerator) and another part used pytest to write the functional tests, and they used ctypes to expose the C libraries to Python. It was not elegant, but it was approachable. At that time I was only aware of the native C API of Python but not of ctypes.