Python Universe
1.99K subscribers
103 photos
1 video
1 file
55 links
Everything you need to know about Python programming.

Admin: @haraisen
Feedback: @pythontg_feedbackbot
Download Telegram
Creating Tables with PrettyTable

🔸
PrettyTable is a simple Python library designed to make it easy to represent tabular data in nice and neat ASCII tables.

⚙️Installation
pip install prettytable

PrettyTable class, provided by this library, allows you to create such a tables. To add a new row to a table, simply set the field names of your table using the field_names attribute, and then add rows using the add_row() method.
You can add columns as well by using the add_column() method, which takes two arguments: the column name and a list or tuple which contains the column data.

🔗GitHub

#prettytable