 
      
      serial::is_open()Get the open status of the serial port
serial::is_open()There are no parameters.
boolean — Returns true if the port is open, and returns false if otherwise
import serial
 
arduino = serial("/dev/ttyACM0")
 
if arduino.is_open()
    writeln("Port is open")
else
    writeln("Port is not open")
endif