Skip to content

Comment on Want to call C from Python? Use Dparent

Comments

Sure, I’ll be more specific: there’s no glue code for function calls. Whatever function you want to call doesn’t need to be declared up front, you just call it at runtime, and it’s looked up dynamically. However, data structures like arrays and structs need to be declared, if needed.

So... ctypes requires writing glue code. The solution in the article doesn't.

"if needed" means "needed with any and all C APIs one would be interested in".

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.