Python pyUSB的问题

Python pyUSB的问题,python,usb,pyusb,Python,Usb,Pyusb,我一直在尝试用Python编写一个程序,将命令发送到DYMO labelmanager PnP usb设备。我尝试安装pyUSB,并尝试pyUSB教程中提供的代码来了解USB通信是如何工作的,但它不起作用。pyUSB教程中的代码: (我已更改idVendor和idProduct以处理我的设备。它找到了设备,但写入失败) 它给出了一个错误: Traceback (most recent call last): File "C:\Python27\proc\labelprinttest.py",

我一直在尝试用Python编写一个程序,将命令发送到DYMO labelmanager PnP usb设备。我尝试安装pyUSB,并尝试pyUSB教程中提供的代码来了解USB通信是如何工作的,但它不起作用。pyUSB教程中的代码:

(我已更改idVendor和idProduct以处理我的设备。它找到了设备,但写入失败)

它给出了一个错误:

Traceback (most recent call last):
  File "C:\Python27\proc\labelprinttest.py", line 18, in <module>
    alternate_setting = usb.control.get_interface(interface_number)
TypeError: get_interface() takes exactly 2 arguments (1 given)
回溯(最近一次呼叫最后一次):
文件“C:\Python27\proc\labelprinttest.py”,第18行,在
备用_设置=usb.control.get_接口(接口编号)
TypeError:get_interface()正好接受2个参数(给定1个)
问题在哪里


(当然,这里读到函数有两个参数,只给出了一个,但我已经尝试过调查,不知道需要的另一个参数是什么)

get\u interface()的定义如下:

def get_interface(dev, bInterfaceNumber):
    r"""Get the current alternate setting of the interface.

    dev is the Device object to which the request will be
    sent to.
    """

所以,试着用
usb.control.get\u接口(dev,interface\u number)

调用它,谢谢,但没有用。现在它给出了一个错误:文件“C:\Python27\lib\site packages\usb\backend\libusb01.py”,第384行,在_checkraise USBError(errmsg,ret)USBError:[Errno None]libusb0 dll:err[control\u msg]发送控制消息失败,win错误:请求不受支持。
def get_interface(dev, bInterfaceNumber):
    r"""Get the current alternate setting of the interface.

    dev is the Device object to which the request will be
    sent to.
    """