IT 116: Introduction to Scripting
Class 19

Today's Topics

Tips and Examples


New Material

Reading Assignment

You should read Chapter 7, Lists and Tuples, from our textbook, Starting Out with Python, before next week's class.

Homework 9

I have posted homework 9 here.

It is due this coming Sunday at 11:59 PM.

Quiz 6

I have posted the answers to Quiz 6 here.

Tips and Examples

A Simple Function


Using Files in Python

Appending Data to an Existing File

Writing and Reading Numbers

Reading the Lines of a File

Using Loops to Process Files

Reading Files with a for Loop

New Material

Running a Script Using python3

Running a Script Without python3

Arranging Data in a File


Reading Records from a File

Removing Linefeed Characters

Cleaning Up the Record Reading Script

Reading Records with a for Loop

Which Loop to Use When Reading a File


Class Quiz