Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Where can I get a pyusb manual?

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
User avatar
Aquiles
Posts: 50
Joined: 2007-07-16 13:45
Location: Somewhere, surrounded by my circumstances

Where can I get a pyusb manual?

#1 Post by Aquiles »

Hi,

I want to access a USB device from a Python script, so I installed python-usb. But so far I've been unseccessfull when trying to find a manual or a reference guide. Would you point me to some documentation resource?

Thanks.
Aquiles

User avatar
sqlpython
Posts: 214
Joined: 2008-09-05 01:36
Location: USA

Re: Where can I get a pyusb manual?

#2 Post by sqlpython »

Take a look here for some ideas
http://bleyer.org/pyusb/
Criticism accepted for solutions that work! ;^)

User avatar
Aquiles
Posts: 50
Joined: 2007-07-16 13:45
Location: Somewhere, surrounded by my circumstances

Re: Where can I get a pyusb manual?

#3 Post by Aquiles »

That's somewhere to start! Thanks.
Aquiles

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

Re: Where can I get a pyusb manual?

#4 Post by Issyer »

Why pyusb?

os.system("sudo mount -t vfat /dev/sdg /media/device")
os.chdir("/media/device")

:roll:

That pyusb is for Windows. It doesn't run on Linux.

User avatar
sqlpython
Posts: 214
Joined: 2008-09-05 01:36
Location: USA

Re: Where can I get a pyusb manual?

#5 Post by sqlpython »

Your snippet of code is useful but he didn't say it was a usb drive.. maybe it is and maybe it isn't.
Could be some other usb device.

Here is an excerpt from one of the pyusb Documentations.......
3.8
FT_OpenEx
Supported Operating Systems
Linux
Mac OS X (10.4 and later)
Windows (2000 and later)
Windows CE (4.2 and later)
:roll:
............. :D The rolling eyes are joke. I just thought I would throw one back at you.
Besides, no matter the OS there are many numbers of code examples in there that are useful to help along a programmer who needs usb help.
Criticism accepted for solutions that work! ;^)

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

Re: Where can I get a pyusb manual?

#6 Post by Issyer »

sqlpython wrote: :roll:
............. :D The rolling eyes are joke. I just thought I would throw one back at you.
Besides, no matter the OS there are many numbers of code examples in there that are useful to help along a programmer who needs usb help.
Really?
When you extract the sourse, don't forget to run it through dos2unix. I mean the one from your link.
Cheers.

User avatar
sqlpython
Posts: 214
Joined: 2008-09-05 01:36
Location: USA

Re: Where can I get a pyusb manual?

#7 Post by sqlpython »

Issyer
Here is some traffic going on......
http://groups.google.com/group/linux.de ... 6ff6ccfa70
Criticism accepted for solutions that work! ;^)

User avatar
sqlpython
Posts: 214
Joined: 2008-09-05 01:36
Location: USA

Re: Where can I get a pyusb manual?

#8 Post by sqlpython »

Sorry I did that in a hurry. I should have added this in the event you would like to work with pyusb for Debian.
..Squeeze
http://packages.debian.org/source/squeeze/pyusb

...Lenny
http://packages.debian.org/source/lenny/pyusb
Last edited by sqlpython on 2009-08-03 16:44, edited 1 time in total.
Criticism accepted for solutions that work! ;^)

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

Re: Where can I get a pyusb manual?

#9 Post by Issyer »

And this is what is going from my terminal:

Code: Select all

alex@box:~/Download$ PyUSB-1.6/test/testProgram.py
bash: PyUSB-1.6/test/testProgram.py: python^M: bad interpreter: No such file or directory
I wonder why.

User avatar
sqlpython
Posts: 214
Joined: 2008-09-05 01:36
Location: USA

Re: Where can I get a pyusb manual?

#10 Post by sqlpython »

I wonder why.
:lol:
Did that cigarette burn down too far.........?
As I just pointed out download and use pyusb..
PyUSB is a separate item for their devices BUT as I said... You can read and learn from the Code Examples in the Documentation.
:?: :?:
Criticism accepted for solutions that work! ;^)

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

Re: Where can I get a pyusb manual?

#11 Post by Issyer »

sqlpython wrote:
I wonder why.
:lol:
Did that cigarette burn down too far.........?
As I just pointed out download and use pyusb..
PyUSB is a separate item for their devices BUT as I said... You can read and learn from the Code Examples in the Documentation.
:?: :?:
Are you sure I need to learn anything?
8)

User avatar
sqlpython
Posts: 214
Joined: 2008-09-05 01:36
Location: USA

Re: Where can I get a pyusb manual?

#12 Post by sqlpython »

Are you sure I need to learn anything?
You be the judge of that....... :)
I know that you didn't compile the source from the makefile before you attempted to run their testProgarm.
Criticism accepted for solutions that work! ;^)

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

Re: Where can I get a pyusb manual?

#13 Post by Issyer »

sqlpython wrote:
Are you sure I need to learn anything?
You be the judge of that....... :)
I know that you didn't compile the source from the makefile before you attempted to run their testProgarm.
Well, if you know how, post your way here. I have a lot of other things to do.

User avatar
sqlpython
Posts: 214
Joined: 2008-09-05 01:36
Location: USA

Re: Where can I get a pyusb manual?

#14 Post by sqlpython »

Well, if you know how, post your way here. I have a lot of other things to do.
Me too, point is that the testProgram calls to import d2xx which you can't have until you compile their source.
I don't use PyUSB over pyusb myself because it has only been tested as they report with Win but my point is that the source is there for the adventurous. It may work fine.
If you remember.... this thread simply started out that a user wanted some help regarding code example for python and USB connections.
You did give one basic to mount a drive which is good.
Also I pointed out a manual of documentation with several coding examples and that may also be a help.
We are off on a tangent as to the usefulness or merits of PyUSB. Apparently, it works for Win and it is Python. Python is cross platform in most respects. I for one really don't care if Aquiles, You or I ever use PyUSB but the examples are still useful.....
and that is what Aquiles was most interested in seeing.

Case closed....
Cheers. :)
Criticism accepted for solutions that work! ;^)

Post Reply