serial and threads

Silke natunika at
Tue Aug 17 12:15:19 CEST 2004

Hi all!

I'm trying to write a program in python using the modules
'serialwin32' and 'thread' to create one thread that writes to a
serial port and another one that reads from it at 'the same time'. My
definitions are

def NetworkToSerial(input):
        print "SENT: %s" % input                  

def SerialToNetwork():
                result =
                print "RECEIVED:"
                print binascii.hexlify(result) 

and I call them with

thread.start_new_thread(NetworkToSerial, (command,))             
thread.start_new_thread(SerialToNetwork, ())

The first one seems to run fine, but for the second one I get the
error message 'ClearCommError', 'the handle is invalid'.

Does anyone have a clue whether maybe serialwin32 is not

Thanks for your help in advance!


More information about the Python-list mailing list