PySerial学习系列1--serial.tools
来源:互联网 发布:如何做淘宝详情页 编辑:程序博客网 时间:2024/06/05 20:41
PySerial中Tools工具获取计算机上所有的Port口
import serial.tools.list_ports后调用serial.tools.list_ports.comports()接口返回计算机上所有的port口信息(当然正对windows用户来讲,也可以调用serial.tools.list_ports_windows.comports()接口),返回的是一个serial.tools.list_ports.
ListPortInfo
类的列表,该类具体信息:
class serial.tools.list_ports.
ListPortInfo
This object holds information about a serial port. It supports indexedaccess for backwards compatibility, as in
port, desc,hwid = info
.device
Full device name/path, e.g.
/dev/ttyUSB0
. This is also theinformation returned as first element when accessed by index.
name
Short device name, e.g.
ttyUSB0
.
description
Human readable description or
n/a
. This is also the informationreturned as second element when accessed by index.
hwid
Technical description or
n/a
. This is also the informationreturned as third element when accessed by index.
USB specific data, these are all
None
if it is not an USB device (or theplatform does not support extended info).vid
USB Vendor ID (integer, 0...65535).
pid
USB product ID (integer, 0...65535).
serial_number
USB serial number as a string.
location
USB device location string (“<bus>-<port>[-<port>]...”)
manufacturer
USB manufacturer string, as reported by device.
product
USB product string, as reported by device.
interface
Interface specific description, e.g. used in compound USB devices.
Comparison operators are implemented such that the
ListPortInfo
objectscan be sorted bydevice
. Strings are split into groups of numbers andtext so that the order is “natural” (i.e.com1
<com2
<com10
).
——
- PySerial学习系列1--serial.tools
- pySerial 学习笔记-安装与测试
- Erlang Build Tools--系列1
- Python使用模块Pyserial模块报<ImportError:No module named tools.list_ports>
- oracle10g ocp学习笔记系列之CH17Advanced Tools and Techniques
- IOS 9 学习系列:Xcode Code Coverage Tools
- 使用patch修补python中serial.tools中的一个Bug
- serial driver 1
- usb-serial-1
- serial
- serial
- serial
- Pyserial使用
- box资源共享---Tools系列
- jquery tools 系列(三)——scrollable(1)
- 【Tools.Gradle】Gradle入门系列(1):简介
- Chrome development tools学习笔记(1)
- PowerCmd v2.1 Serial Numbers
- 算法分析课每周练习 Trapping Rain Water
- AutoIt3 自动化工具
- Oracle序列
- python一些包的说明文档/教程链接
- OpenWRT刷机入门
- PySerial学习系列1--serial.tools
- POJ 1029--False coin
- c++ 零散重要知识点
- Java 关于HashTable和SynchronizedMap线程安全的分析
- Scala class和case class的区别
- gRPC开发入门
- 解决scrapy存储json中文默认为Unicode编码问题
- PAT甲级 1028. List Sorting (25)
- 数组和列表的选择