def read_serial(console):
 data_bytes = console.inWaiting()
 if data_bytes:
  return console.read(data_bytes)
 else:
  return ''

def read_serial ( console ) : data_bytes = console . inWaiting ( ) if data_bytes : return console . read ( data_bytes ) else : return ''
check if there is data waiting to be read read and return it .