
#PYTHON SERIAL PORT EXAMPLE WINDOWS PC#
When my USB to COM gateway is connected to the PC (I see the COM5 in the Device Manager), this COM port isn’t included in the list returned by list_ports(). Print(list(_ports()))īut it seems that it doesn’t work.

I have found in the pySerial API () a function _ports() that lists com ports (exactly what I want). I am using Python 3 with pySerial on a Windows 7 PC. I have found this method but it is Windows-specific: Listing serial (COM) ports on Windows?

I am searching for a simple method to list all available com port on a PC. Question or problem about Python programming:
