python: use regular expression to remove the white space from all lines,"re.sub('\\s+\\Z', '', s)"