nonblocking reads in windows?

Jirka 'Eagle' Novak eagle at
Tue Aug 27 07:47:28 EDT 2002

Joe Connellan wrote:
> I'm on WinXP, there is no problem opening the com port, no errors, etc. But if I
> try to write or read from it nothing happens - I know my com port works and the
> config is correct as I can use it with, etc.

This code work for me. Are you *absolutely* sure you read data from the 
port correctly?

import serial
import serial.serialutil

SEND_STR = "Hello, this is just a test.\n\r"

     comm = serial.Serial("COM1")
     raw_input("Press Enter to send data")
     raw_input("Press Enter to set RTS high.")
     raw_input("Press Enter to close port.")
except serial.serialutil.SerialException:
     print ">>> Exception: could not open communication port"

Jirka 'Eagle' Novak
registered linux user #173581

E-Mail:   eagle at
ICQ:      46044619

More information about the Python-list mailing list