Answer the question
In order to leave comments, you need to log in
How should you call C functions in Python?
Problem:
You need to make a call to a C function in Python. While made through creation of dll in VS. But it turned out that the dll created in this way cannot be used, for example, under Linux. And I want the program to work under any operating system.
Can you please tell me how to call a C function in python. Maybe you can do everything without dll?
Answer the question
In order to leave comments, you need to log in
Under linux, everything is about the same . For different systems, the C code must be recompiled, and this is indispensable.
Is there any alternative that doesn't exist? After all, it would seem that both there and there are ordinary c code + ordinary python.
Under Linux, instead of .dll, you need to build the code in .so, and to call functions, you can use ctypes, which works fine with dynamic libraries for both win and tench
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question