G
Grant Edwards
Ok you write that it close :Because the "ser" object is never
used after that point, so it get's garbage collected and
deleted.
Yes.
But for example if i make one button with the same caracteristic of the
previous com port:
def OnButton1Button(self, event):
ser = serial.Serial(0)
But with
a = textCtrl1GetValue() # i put here some different string
to send
ser.write (a)
b = ser.readline()
textCtrl2SetValue(b)
I have no idea what you mean by that. POST THE CODE. With
both button handlers.
I'm GUESSING (since you won't post enough code for me to
actually figure it otu) that "ser" is local to your button
handlers and it's going out of scope and getting deleted when
the button handler returns.
Do you understand what I wrote above?
why at any read the serial close, is possible to prevent the
closure of the port?
Yes. Make sure the "ser" object doesn't get deleted.