On 2006-03-07, Steve Holden <[EMAIL PROTECTED]> wrote: >>>Here is my code; why after the readline the port close? >>> >>> ser = serial.Serial(0) >>> ser.baudrate = 9600 >>> ser.parity = serial.PARITY_ODD >>> ser.stopbits = serial.STOPBITS_TWO >>> ser.bytesize =serial.EIGHTBITS >>> ser.setRTS(level = 0) >>> ser.setDTR(level = 0) >>> ser.timeout = 1 >>> >>> ser.readline() >>> >>> Why after this the port close. >> >> Because the "ser" object is never used after that point, so it >> get's garbage collected and deleted. > > ???? > > The "ser" name is still bound to the serial object, surely?
I don't see any references to ser after the call to ser.readline(). Do you? ;) I was trying to make the point [again] that it's impossible to to tell what's going on because the OP refuses to post enough of his code to allow meaningful analysis. He's been told at least three times in as many postings that he needs to post a complete example that demonstrates the problem he's trying to solve, but he refuses. I've explained multiple times that the "excerpts" he's posting aren't sufficient. He persists in posting small snippets of mostly-irrelevant code with no context. I give up. I have a feeling I'm just annoying the mule at this point. -- Grant Edwards grante Yow! It don't mean a at THING if you ain't got visi.com that SWING!! -- http://mail.python.org/mailman/listinfo/python-list