Win32/Python serial port event character problem

Derek Basch dbasch at
Sat Jun 29 15:45:43 EDT 2002

Sorry to post this again but it didn't get any
responses. Maybe better luck this time.

I use the following code to read data from the serial
port when a certain event character ('\n') is

It seems to work fine except for that when I send the
following data via the serial port:

the output is:

Comport Thread:test 1
Comport Thread:
test 2
Comport Thread:st 3
Comport Thread:t 4
test 5

It seems to me that in the time between the event
character being received and the ReadFile operation
occurring additional characters are being placed into
the windows OS serial buffer.
Has anyone ever dealt with this? Is using the event
character not a reliable method in windows?
I know the event character is being triggered because
I can change the event character to 'g' and nothing
happens unless a 'g' is in the received data.
I have obviously left out some of the code in the
example but I hope everyone will understand it ok.
This is driving me batty so any help is greatly
Derek Basch
1 very unskilled win32 programmer.

Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

More information about the Python-list mailing list