CH347

动态库封装实例

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 模块

posted @ 2024-04-02 11:08  BISTER  阅读(134)  评论(0)    收藏  举报  来源