Jun-30-2018, 04:42 PM
python-tabulate to take the more lazy way than @ichabod801
![Wink Wink](https://python-forum.io/images/smilies/wink.png)
>>> from tabulate import tabulate >>> knights = [['Sir Lancelot', 'The Holy Grail', 'Blue'], ['Sir Robin', 'The Holy Grail', "I don't know that."], ['Sir Galahad', 'The Grail', 'Blue. No, yel...'], ['King Arthur', 'The Holy Grail', 'What do you mean?']] >>> print(tabulate(knights)) ------------ -------------- ------------------ Sir Lancelot The Holy Grail Blue Sir Robin The Holy Grail I don't know that. Sir Galahad The Grail Blue. No, yel... King Arthur The Holy Grail What do you mean? ------------ -------------- ------------------ >>> print(tabulate(knights, tablefmt="pipe")) |:-------------|:---------------|:-------------------| | Sir Lancelot | The Holy Grail | Blue | | Sir Robin | The Holy Grail | I don't know that. | | Sir Galahad | The Grail | Blue. No, yel... | | King Arthur | The Holy Grail | What do you mean? | >>> print(tabulate(knights, tablefmt="fancy_grid")) ╒══════════════╤════════════════╤════════════════════╕ │ Sir Lancelot │ The Holy Grail │ Blue │ ├──────────────┼────────────────┼────────────────────┤ │ Sir Robin │ The Holy Grail │ I don't know that. │ ├──────────────┼────────────────┼────────────────────┤ │ Sir Galahad │ The Grail │ Blue. No, yel... │ ├──────────────┼────────────────┼────────────────────┤ │ King Arthur │ The Holy Grail │ What do you mean? │ ╘══════════════╧════════════════╧════════════════════╛