Calling the dll file to Python Ctypes/Live Beginners

Asked 2 years ago, Updated 2 years ago, 98 views

My friend wrote a calculation program in C language (not a calculator program) I want to decorate the graphic UI with C and Python. First of all, I converted my friend's C file into a .dll file. I know that there is Ctypes as a way to call and write this file from Python, so I want to call the .dll file. I used almost every example on the Internet, but I could not load and use the dll file. I'd like to get help with Python raw choco. Also, there are some people telling me to use Cython? I want to get the output value of C and float it in the Python graphics program while I'm already done with the code in C, and I'm also curious about the example. <

python c# dll

2022-09-22 10:42

1 Answers

The dotnet assembly is not a native code.

That is, you cannot call the ctypes module from cpython.

If you want to use dotnet assemblies in cpython, review pythonnet (https://github.com/pythonnet/pythonnet).

In addition, gui programming with Python is relatively less productive than winform and wpf, which can utilize tools such as visual studios.

There is no suitable gui builder for gui development with Python, and it is difficult to distribute. Of course, there is a qt degsiner, but it is not comparable to a visual studio.

Rather, the recommended method is to develop gui with winform and wpf and embed python to construct business logic.

Of course, it is better to configure it with 3 tier, develop api server with python (http), and call (consume) the api with dotnet.


2022-09-22 10:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.