Python编写串口测试小工具

  • Post author:
  • Post category:python




Python串口工具模块基本使用——pyserial

  • 首先安装Python的serial支持库
pip install pyserial
  • 最简单的python测试代码
import serial
import  time

ser = serial.Serial(port='COM13',baudrate=38400,parity=serial.PARITY_NONE,
                    bytesize=serial.EIGHTBITS, stopbits=serial.STOPBITS_ONE)

ser.write(b'hello')



版权声明:本文为eyhxh原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。