如何从Python写入Vista中的串口?termios包似乎只支持posix.
pyserial做的伎俩,你需要Windows的python扩展,以便它在Windows中工作.
似乎使用pyserial并不比这更难:
import serial ser = serial.Serial(0) # open first serial port with 9600,8,N,1 print ser.portstr # check which port was really used ser.write('hello') ser.close()