Python dll means: 1. The DLL file is a dynamic link library, which is a way for Microsoft to implement the concept of shared function library in the Microsoft Windows operating system; 2. The DLL can be simply regarded as a A kind of warehouse, which provides some variables, functions or classes that can be used directly.
python dll means:
What is a DLL file?
The DLL file is a dynamic link library (English: Dynamic-link library, abbreviated as DLL)
It is a part of Microsoft Corporation that implements the concept of shared function libraries in the Microsoft Windows operating system. An implementation method
Let’s first explain the concept of DLL (Dynamic Linkable Library). You can simply think of DLL as a kind of warehouse, which provides you with some variables, functions or classes that can be used directly. In the history of warehouse development, it has gone through the era of "no library - static link library - dynamic link library". Static link libraries and dynamic link libraries are both ways of sharing code. If you use a static link library, the instructions in the lib will be directly included in the final generated EXE file whether you like it or not. However, if a DLL is used, the DLL does not have to be included in the final EXE file. When the EXE file is executed, the DLL file independent of the EXE can be "dynamically" referenced and unloaded. Another difference between static link library and dynamic link library is that the static link library cannot contain other dynamic link libraries or static libraries, while the dynamic link library can also contain other dynamic or static link libraries.
Use Python to execute DLL files:
from ctypes import cdll def run_dll(dll_path, execute_function): """ 执行DLL文件内部指定的函数 :param dll_path: DLL文件的所在路径 :param execute_function: DLL文件内部要被执行的函数名 :return: """ dll_object = cdll.LoadLibrary(dll_path) # 实例化DLL对象 eval('dll_object.{}()'.format(execute_function)) # 调用DLL文件内的指定程序 if __name__ == '__main__': path = r'C:\Users\evaliu\Desktop\example.dll' run_dll(dll_path=path, execute_function='communication_test')
Related learning recommendations: python video
The above is the detailed content of What does python dll mean?. For more information, please follow other related articles on the PHP Chinese website!