Python Forum

Full Version: Read Data from Serial port
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Team

Is Amy one who have code for read data from Serial port like Arduino and put the reading to the Entry Widgets or Text widget

I have a code which can read data coming from Serial port and it showing on the Python shell . But I need to visible it on the Entry Widget or Text Widget

Note: I can manage Arduino code Therefore I not need Adruino code

Thanks in advanced
you can use pyserial, to install pip install pyserial
documentation has ample examples:
@PA3040 I have done this already and what @Larz60+ pointed out is one way to get started on that but once you do get that you are going to discover lots of little oddities and unfriendlinesses with it -- unless you have someone who can point those out to you in advance still...

If you already have a python program that pulls data from a serial device through a serial port then make that its own separate class and using whatever you already are using (aka you do not need pyserial) just send that data to your python-qt application. I can show you how to do this as well if you are wanting help with that. Basically use the MVC methodology keeping your Data Source (Model) completely separated from your GUI (View) and passing that data through your Controller module