[PyQt] Basic serial question

Dmitry Shachnev mitya57 at ubuntu.com
Sun Sep 24 14:55:58 BST 2017


On Sun, Sep 24, 2017 at 11:21:55AM +1000, Phil wrote:
> Thank you for reading this.
>
> Using Eric, I'm trying to take text from an edit box and then transmit it
> via a serial port. The following console code proves that the serial data is
> being received correctly.
>
> import serial
>
> ser = serial.Serial('/dev/ttyACM0',9600)
> ser.write(b'Fred\n')
>
> To create an Eric GUI, the way I understand a QT C++ example, is that I have
> to import QSerialPort. The problem is that the Eric error message says that
> there isn't a QSerialPort or QtSerialPort module. I have installed
> python3-pyqt5.qtserialport.

You can import it like this:

from PyQt5.QtSerialPort import QSerialPort

However it is not a GUI, it is just a Qt implementation of serial ports.
It does more or less the same thing as pyserial, so there is no sense in
using them together.

--
Dmitry Shachnev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170924/e0e08093/attachment.sig>


More information about the PyQt mailing list