[PyQt] Using QSerialPort() instead of pyserial

Phil phil_lor at bigpond.com
Sun Nov 19 22:20:19 GMT 2017


Thank you for reading this.

I may have rambled on a bit in my previous question, so instead I'll ask 
how I might implement the following using QSerialPort() instead of pyserial?

import serial

ser = serial.Serial('/dev/ttyACM0', 9600, timeout = 5)

while 1:
     data = ser.readline()

     print(data)

ser.close()

This seems to be the equivalent but nothing is printed.

while (self.serial.waitForReadyRead(5000)):
     data = self.serial.readAll()
     print(:data = ")

-- 
Regards,
Phil


More information about the PyQt mailing list