21 - File IO

Alina

Goals

  • Be able to read a file from the computer
  • Be able to write to a file on the computer
  • Know different file formats, be able to differentiate these formats

Slides

File IO

Homework

Exercise 1

  • Download and save a txt file http://norvig.com/big.txt
  • Replace "Sherlock" name with your name
  • Create and save the data to a new file with the name "Adventures of your name"

Exercise 2

  • Create 2 different files
  • Read both of them
  • Create a new file that has data from two files

Exercise 3 (CSV)*

  • Create a csv file with payments
id, amount, category, month, year
1, 10.0, Cafe, 10, 2019
2, 2100.0, Salary, 10, 2019
 ...
  • find a library to work with csv files, parse the file
  • add these data to your Bank Application

Exercise 4 (XML)*

  • Create an xml file with payments
  • find a library to work with xml files, parse the file
  • add these payments to your Bank Application

Exercise 5 (json)*

  • Create a json file with payments
  • find a library to work with json files, parse the file
  • add these payments to your Bank Application

Exercise 6 (json)*

  • Create few payments
  • Save these payments as json file
Last Updated: 11/3/2019, 2:58:07 PM