J. Correia Lopes

FEUP/DEI & INESC TEC

User Tools

Site Tools


teach:fpro:lectures:21

T: 11/12/2018

Master in Informatics and Computing Engineering
Programming Fundamentals
Instance: 2018/2019


Lecture #21 :: 11/12/2018

Goals

By the end of this class, the student should be able to:

  • Describe reading data from external storage to be manipulated by the program
  • Describe how to make data outlive the program that creates it

Content

  • Files
    • 7.1 About files
    • 7.2 Writing our first file
    • 7.3 Reading a file line-at-a-time
    • 7.4 Turning a file into a list of lines
    • 7.5 Reading the whole file at once
    • 7.6 An example
    • 7.7 Directories
    • 7.8 Fetching resources from the Web

Bibliography

  • Peter Wentworth, Jeffrey Elkner, Allen B. Downey, and Chris Meyers, How to Think Like a Computer Scientist — Learning with Python 3, 2018 (Chapter 7) PDF]

Materials

  • J. Correia Lopes, Script and illustrations, 21-files.pdf
  • FPRO, 2018/19, Python code, Lecture's on GitHub
  • Brad Miller and David Ranum, How to Think Like a Computer Scientist: Interactive Edition, Based on material by Jeffrey Elkner, Allen B. Downey, and Chris Meyers (Chapter 11) HTML
  • The Python Standard Library, 11. File and Directory Access, HTML

Summary

  • Files. Writing to a file. Reading a file line-at-a-time. Directories. Fetching resources from the Web.

FPRO, 2018/19

« Previous | Index | Next »

teach/fpro/lectures/21.txt · Last modified: 09/12/2018 21:43 by Correia Lopes