def remove_empty_line(content):
 r = re.compile('^\\s+$', (re.M | re.S))
 s = r.sub('', content)
 r = re.compile('\\n+', (re.M | re.S))
 s = r.sub('\n', s)
 return s

def remove_empty_line ( content ) : r = re . compile ( '^\\s+$' , ( re . M | re . S ) ) s = r . sub ( '' , content ) r = re . compile ( '\\n+' , ( re . M | re . S ) ) s = r . sub ( '\n' , s ) return s
remove multi space .