0
votes

I would like to determine the number of available serial ports, including those provided by USB adapters, under both Linux and windows without having to adapt the program for specific platforms.

I seem to be chasing my tail at the moment and would appreciate another angle on this.

Using pyserial is easy enough on either platform for using the ports, but how do you find out how many ports are available?

1

1 Answers

0
votes

Does the example not work for you:

http://pyserial.svn.sourceforge.net/viewvc/checkout/pyserial/trunk/pyserial/examples/scan.py

It is a bit brute force (it just tries to connect to every port and ones that throw an exception are ignored as not present).