According to documentation, class serial.Serial()
has the following methods.
close()
Close port immediately.
__del__()
Destructor, close port when serial port instance is freed.
I would like to know when I should use close()
and __del__()
? Example, I have a GUI that created an instance of serial.Serial()
with an assigned port. According to documentation, the assigned port will be opened when the instance of serial.Serial()
. Now when I terminate my GUI, am I correct to say that __del__()
(and not close()
) is the most appropriate method to use to close the serial port?