def tabulate(lol, headers, eol='<STR_LIT:\n>'):
yield '<STR_LIT>' % '<STR_LIT>'.join(headers) + eol<EOL>yield '<STR_LIT>' % '<STR_LIT>'.join(['<STR_LIT:->' * len(w) for w in headers]) + eol<EOL>for row in lol:<EOL><INDENT>yield '<STR_LIT>' % '<STR_LIT>'.join(str(c) for c in row) + eol<EOL><DEDENT>
Use the pypi tabulate package instead!