-1

I am unable to proceed on how PyUSB works. I am stuck for a week now. How do I proceed?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
vj85
  • 577
  • 3
  • 7
  • 12
  • 1
    You should try and be more specific. I'm sure that `pyusb` *works*, however it is difficult to tell what you're having trouble with. What are you trying to achieve? What have you tried? How did it fail? – jensgram Mar 03 '11 at 08:55
  • 2
    Always when you as a question include: 1. What you are trying to do. 2. Why you are trying to do it. 3. What happened when you did it. 4. What you expected to happen. – Lennart Regebro Mar 03 '11 at 11:35

1 Answers1

14

At first glance, documentation for PyUSB seems to be entirely absent. But not so.

From a Python prompt you can:

 >>> import usb
 >>> help(usb)

And it turns out to have documentation!

 >>> help(usb.core)

Was quite useful. It seems quite straightforward.

Lennart Regebro
  • 167,292
  • 41
  • 224
  • 251
  • i have tried but when i try to access the find function in usb.core i get the following error i am trying to access it in windows >>> dev=usb.core.find() Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\site-packages\usb\core.py", line 819, in find raise ValueError('No backend available') ValueError: No backend available – vj85 Mar 03 '11 at 10:16
  • @vj85: So you are on Windows. You should have mentioned that. You need to install either libusb or openusb, which are the libraries that are supported. Libusb seems the better bet there. http://sourceforge.net/apps/trac/libusb-win32/wiki – Lennart Regebro Mar 03 '11 at 11:34
  • hey sorry i forgot to mention that i am using python 2.7.. will it be compatible. – vj85 Mar 03 '11 at 13:28
  • are there any other additions for Pyusb to work.if yes please let me know.. – vj85 Mar 04 '11 at 04:18
  • Will i be able to control the usage of USB.i.e. 1.When USB wireless dongle Connected to system, it should not automatically be installed. 2. The Script written has to have the control of the USB's accessibility and performance. 3.When connected to any of the ports on the system then the script has to be the first program to be executed. – vj85 Mar 04 '11 at 05:06
  • @vj85: I don't think so. You are now talking about changing the behavior of the system and it's drivers. I don't think you can do that with PyUSB, and I see no reason why you should. PyUSB is for talking to USB devices, not a hook into the OS's driver management system. Rememer: When asking questions always explain *why* you are trying to do what you are trying to do. pyUSB is most likely the wrong solution for you, whatever you are trying to do. – Lennart Regebro Mar 04 '11 at 06:16