Week 6

Pizza Py

Read rows from a CSV file and print them as a table.

You type

A CSV file name after the program name.

The tool
Rows become a table A CSV file Each row A printed table
What comes out

A table. The wrong arguments stop the program.

The question, more slowly

The question is: one CSV file on the command line, and you print it as a table. The first row is the headers. Later rows are the pizzas. The table should line up the way the spec's library does it.

A CSV reader gives you rows. A dict reader gives you each row as a dictionary keyed by the header. The spec says which one, and which library draws the table. You pass the rows to that library. You do not draw the lines yourself.

People forget the file has to be named on the command line, or they print the raw commas. Wrong arguments should exit with the message in the spec.

Before you code

Open a CSV in a text editor and point at the header row and one data row. They are different.