Python Forum

Full Version: Serial port Auto detection GUI Tour
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear All I have decided to start a education lesson for those who come to serial port and Serial Port GUI like auto port detection while learning my self
This is step by step tour without hard coding abd easy to understand beginner who comes to this forum

The very simple code for Serial port detection

1 Install pySerial using pip install

we can detect serial port using three codes as showing follows

import serial.tools.list_ports


ports = list(serial.tools.list_ports.comports())
for p in ports:
    print (p)
Once you run the code you can see that in python shell the connected serial port name in my case I used Adrduno Uno CH340 Driver

COM15 - USB-SERIAL CH340 (COM15)
Using above three code we can check the what are device connected for the serial port

next STEP is create a simple GUI using Tkinter

Any one else can cognitive this tour using very simple code which beginner can understand