Archives May 21, 2015

Python, table printing

Published May 21, 2015 in Development - Last update on July 6, 2015.

I always self-asked me how is the code used by mysql command for print tables. I ever don't know but I know how to do that in Python: With Format Specification Mini-Language.

Print a table

A script of my idea looks like this:

GUYS = ['tony', 'joe', 'ugo']
ROW_FORMAT = '| {0:5} | {1:30} |'

print(ROW_FORMAT ...

Continue reading