def split_in_lines(text):
 return (line for line in map(str.strip, text.split('\n')) if line)

def split_in_lines ( text ) : return ( line for line in map ( str . strip , text . split ( '\n' ) ) if line )
split a block of text in lines removing unnecessary spaces from each line .