动态库封装实例
import ctypes
# Load the CH347DLL library
ch347dll = ctypes.WinDLL('CH347DLLA64.dll') # Update the filename if necessary
# Define the argument and return types for CH347OpenDevice
ch347dll.CH347OpenDevice.argtypes = [ctypes.c_ulong]
ch347dll.CH347OpenDevice.restype = ctypes.c_bool
# Define the argument and return types for CH347CloseDevice
ch347dll.CH347CloseDevice.argtypes = [ctypes.c_ulong]
ch347dll.CH347CloseDevice.restype = ctypes.c_bool
动态库封装成 python 模块