#NEWLINE# def send( self , data = b'\n' ) : #NEWLINE# #INDENT# '\n        Writes data bytes to serial device port.\n        Returns number of bytes sent\n        ' #NEWLINE# try : #NEWLINE# #INDENT# count = os . write ( self . fd , data ) #NEWLINE# #UNINDENT# except OSError as ex1 : #NEWLINE# #INDENT# if ( count . errno == errno . EAGAIN ) : #NEWLINE# #INDENT# count = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# return count