parameters: (self, size=1)
return_statement: return bytes(data)
docstring: Read size bytes from the serial port. If a timeout is set it may
             return less characters as requested. With no timeout it will block
             until the requested number of bytes is read.
docstring_summary: Read size bytes from the serial port. If a timeout is set it may
             return less characters as requested. With no timeout it will block
             until the requested number of bytes is read.
docstring_tokens: Read size bytes from the serial port . If a timeout is set it may return less characters as requested . With no timeout it will block until the requested number of bytes is read .
function: def read(self, size=1):
          """Read size bytes from the serial port. If a timeout is set it may
             return less characters as requested. With no timeout it will block
             until the requested number of bytes is read."""
          if not self._port_handle: raise portNotOpenError
          # must use single byte reads as this is the only way to read
          # without applying encodings
          data = bytearray()
          while size:
              try:
                  data.append(self._port_handle.ReadByte())
              except System.TimeoutException, e:
                  break
              else:
                  size -= 1
          return bytes(data)
function_tokens: def read ( self , size = 1 ) : if not self . _port_handle : raise portNotOpenError # must use single byte reads as this is the only way to read # without applying encodings data = bytearray ( ) while size : try : data . append ( self . _port_handle . ReadByte ( ) ) except System . TimeoutException , e : break else : size -= 1 return bytes ( data )