vendredi 22 avril 2016

How do I print tables from an SQLite databse in python?

So I have a database of information that I would like to print in a nice table format, held as an SQLite db file.

The only print statements I have seen print the information in a confusing manner, not aligning the attributes of different entities, no column headers etc.

('NORI', 'DRY', 'SHELVES', '50G', 3.4, 20.0, 4.42, 5.303999999999999, 3.0, >13.26, 15.911999999999999, 2.6519999999999992, 10.2, 3.0600000000000005) ('CURRY SAUCE', 'DRY', 'SHELVES', '500G', 5.65, 25.0, 7.345000000000001, >9.18125, 1.0, 7.345000000000001, 9.18125, 1.8362499999999997, 5.65, >1.6950000000000003) ('SALMON', 'CHILLED', 'FRIDGE', '100G', 1.25, 20.0, 1.625, 1.95, 3.0, 4.875, >5.85, 0.9749999999999996, 3.75, 1.125) ('EDAMAME', 'CHILLED', 'FRIDGE', '100G', 3.0, 19.0, 4.0, 5.0, 3.0, 12.0, 15, >3.0, 9.0, 3.0)

Is there any way to print this as a table?

Aucun commentaire:

Enregistrer un commentaire