Skip to Content
Modern Python Standard Library Cookbook
book

Modern Python Standard Library Cookbook

by Alessandro Molina
August 2018
Intermediate to advanced
366 pages
10h 14m
English
Packt Publishing
Content preview from Modern Python Standard Library Cookbook

Reading and writing CSV

CSV is considered one of the best exchange formats for tabular data; nearly all spreadsheet tools support reading and writing CSV, and it's easy to edit it with any plain text editor as it's easy for humans to understand.

Just split and set the values with a comma and you have practically written a CSV document.

Python has very good built-in support for reading CSV files, and we can easily write or read CSV data through the csv module.

We will see how it's possible to read and write a table:

"ID","Name","Surname","Language"
1,"Alessandro","Molina","Italian"
2,"Mika","Häkkinen","Suomi"
3,"Sebastian","Vettel","Deutsch"
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Matthew Wilkes

Publisher Resources

ISBN: 9781788830829Supplemental Content