Drive files coded in C language with Python interface

Asked 2 years ago, Updated 2 years ago, 18 views

Is that possible?

I'm going to make a calculation program in C language and make the interface Python, but I don't know how to mix the two methods <

python

2022-09-22 18:42

1 Answers

Python's extension is a worry because there are so many ways.

You can call the so, dll library directly using ctypes.

Next is the expansion module.There are also various support modules in the extended module range. Of course, the purpose of this module is to automatically generate wrapper codes.

How to write c/c++ code one at a time, even though it's the least productive.This method is written one by one by one by the developer, so you can create a clean, unmixed code.

However, because large libraries are too productive to wrap, they usually use related modules. Representative things are described in the link.

https://wiki.python.org/moin/IntegratingPythonWithOtherLanguages

I personally recommend Cython for the module I recommend, and I recommend using the sython magic of Jupyter for the development environment.


2022-09-22 18:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.