<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>python on seth-shi</title><link>https://sethix.com/tags/python/</link><description>Recent content in python on seth-shi</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 28 Mar 2025 21:31:03 +0800</lastBuildDate><atom:link href="https://sethix.com/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Calling C++ Dynamic Libraries in Python</title><link>https://sethix.com/posts/2025032821/</link><pubDate>Fri, 28 Mar 2025 21:31:03 +0800</pubDate><guid>https://sethix.com/posts/2025032821/</guid><description>When working on a Python project recently, I needed to call C++ dynamic library files. Both Python&amp;rsquo;s built-in ctypes library and the pybind11 library can interface with dynamic libraries. ctypes Use ctypes for simple data types - it&amp;rsquo;s preinstalled with Python and straightforward to use However, when dealing with C++ complex types like vector, it throws Segmentation fault (core dumped) errors because ctypes lacks native support for vector type mapping Reference: https://stackoverflow.</description></item></channel></rss>