Write a C++ extension module for Python

Posted by bob on Nov 25, 2022 2:00 AM
By Opensource.com
Mail this story
Web version

In this article, I’ll show you how to write an extension module. Instead of plain C, I use C++ because most compilers usually understand both. I have to mention one major drawback in advance: Python modules built this way are not portable to other interpreters. They only work in conjunction with the CPython interpreter. So if you are looking for a more portable way of interacting with C libraries, consider using the ctypes module.

Full Story

Printed at http://lxer.com/module/newswire/view/323466/index.html