How to check if device is connected Pyserial
问题 I am connecting with my Arduino through a USB port and sending data to it by using PySerial module. At first I can check if the device is connected by using this code: try: ser = serial.Serial("COM3", 9600) except serial.serialutil.SerialException: print "Arduino not connected" Now what I want to do is to check periodically if the Arduino is still connected to the computer. I tried ser.isOpen() but this returns true even if the Arduino is disconnected. I would also like to know how to