Creating a table in Python

Install tabulate package as below from your command prompt:


Using tabulate to draw a table in Python:

from tabulate import tabulate

sites = [['Website Name','Domain'],['embeddeddesignblog.blogpot.com','Embedded'],['py-programmers.blogspot.com','Python'],['Way2Know','YouTube']]

print(tabulate(sites, headers='firstrow'))


--------------------------------

More details about tabulate from the below link:

https://pypi.org/project/tabulate/

Post a Comment

0 Comments