def readUntilWhitespace(stream, maxchars=None):
 txt = b_('')
 while True:
  tok = stream.read(1)
  if (tok.isspace() or (not tok)):
   break
  txt += tok
  if (len(txt) == maxchars):
   break
 return txt

def readUntilWhitespace ( stream , maxchars = None ) : txt = b_ ( '' ) while True : tok = stream . read ( 1 ) if ( tok . isspace ( ) or ( not tok ) ) : break txt += tok if ( len ( txt ) == maxchars ) : break return txt
reads non-whitespace characters and returns them .