我使用Windows7和Python 2.7。
当我使用pyserial
的{{1}}函数时,发生错误:
serial.serialutil.serialExeption:尝试使用未打开的端口
line = self.ser.readline()
try:
self.ser = serial.Serial(self.port, DEFAULT_BAUDRATE,
parity=serial.PARITY_NONE,stopbits=serial.STOPBITS_ONE,\
bytesize=serial.EIGHTBITS,timeout=2)
except serial.SerialException as e:
print "cannot open com port"