I want to have real tabs in a print but \\t only puts spaces.
Eg:
first:ThisIsLong second:Short
first:Short second:ThisIsLong
Compute the maximum width needed for each column and then use string formatting to compose a format which specifies the desired width:
data = [['first:ThisIsLong', 'second:Short'],
['first:Short', 'second:ThisIsLong'],
['first:ThisIsEvenLonger', 'second:Short']]
widths = [max([len(item) for item in col]) for col in zip(*data)]
fmt = ''.join(['{{:{}}}'.format(width+4) for width in widths])
for row in data:
print(fmt.format(*row))
yields
first:ThisIsLong second:Short
first:Short second:ThisIsLong
first:ThisIsEvenLonger second:Short