同步操作将从 mirrors_pyusb/pyusb 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
PyUSB provides for easy access to the host machine's Universal Serial Bus (USB) system for Python 3.
Until 0.4 version, PyUSB used to be a thin wrapper over libusb. Starting with the 1.0 version, things changed considerably: now PyUSB is an API rich, backend neutral Python USB module easy to use.
The best way to get started with PyUSB is to read the following documents:
For more detailed information, PyUSB's API documentation, as with most Python modules, is based on Python doc strings and can be manipulated by tools such as pydoc [1]:
$ python -m pydoc usb
The libusb 1.0 documentation is also a recommended read, especially when using that backend (more on this bellow).
PyUSB is primarily developed and tested on Linux and Windows, but it should also work fine on any platform running Python >= 3.7, ctypes and at least one of the built-in backends.
PyUSB supports libusb 1.0, libusb 0.1 and OpenUSB. Of those, libusb 1.0 is currently recommended for most use cases.
On Linux and BSD, these will generally be available on the distribution's official repositories.
On macOS, libusb 1.0 can easily be installed through Homebrew:
$ brew install libusb
On Windows, pyocd/libusb-package is a convenient [2] [3] way to provide the
necessary libusb 1.0 DLL, as well as a suitable PyUSB backend and a easy to use
wrapper over PyUSB's find()
API:
# with pure PyUSB for dev in usb.core.find(find_all=True): print(dev) # with pyocd/libusb-package for dev in libusb_package.find(find_all=True): print(dev)
Alternatively, the libusb 1.0 DLL can be manually copied from an official
release archive into the C:\Windows\System32
system folder, or packaged
together with the complete application.
PyUSB is generally installed through pip [1]:
# the latest official release python -m pip install pyusb # install a specific version (e.g. 1.2.1) python -m pip install pyusb==1.2.1 # the latest snapshop from the official git repository python -m pip install pyusb git+https://github.com/pyusb/pyusb#egg=pyusb
Most Linux distributions also package PyUSB in their official repositories.
If you have a question about PyUSB:
To report a bug or propose a new feature, use our issue tracker. But please search the database before opening a new issue.
[1] |
(1, 2) On systems that still default to Python 2, replace python with
python3 . |
[2] | Unlike PyUSB, pyocd/libusb-package uses the more restrictive Apache 2.0 license. |
[3] | While pyocd/libusb-package supports platforms other than Windows, there are advantages to sticking to a system-provided libusb, if it is available and the platform has a robust package manager (e.g. Linux, BSD, macOS with Homebrew). |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。