The pyusb tutorial has an example of using the control transfer functions.
http://pyusb.sourceforge.net/docs/1.0/tutorial.html
>>> msg = 'test'
>>> assert dev.ctrl_transfer(0x40, CTRL_LOOPBACK_WRITE, 0, 0, msg) == len(msg)
>>> ret = dev.ctrl_transfer(0x40, CTRL_LOOPBACK_READ, 0, 0, len(msg))
>>>
2011/3/23 Brendan Simon (eTRIX) :
> The pyusb tutorial has an example of using the control transfer functions.
>
> http://pyusb.sourceforge.net/docs/1.0/tutorial.html
>
msg = 'test'
assert dev.ctrl_transfer(0x40, CTRL_LOOPBACK_WRITE, 0, 0, msg) == len(msg)
ret = dev.ctrl_transfer(0x4