def get_stripped_lines(string, ignore_lines_starting_with=''):
 string = unicode(string)
 lines = [unicode(l.strip()) for l in string.splitlines()]
 if ignore_lines_starting_with:
  filter_func = (lambda x: (x and (not x.startswith(ignore_lines_starting_with))))
 else:
  filter_func = (lambda x: x)
 lines = filter(filter_func, lines)
 return lines

def get_stripped_lines ( string , ignore_lines_starting_with = '' ) : string = unicode ( string ) lines = [ unicode ( l . strip ( ) ) for l in string . splitlines ( ) ] if ignore_lines_starting_with : filter_func = ( lambda x : ( x and ( not x . startswith ( ignore_lines_starting_with ) ) ) ) else : filter_func = ( lambda x : x ) lines = filter ( filter_func , lines ) return lines
split lines at newline char .