Introduction to: Computers & Programming: Input and Output ...

Introduction to:

Computers & Programming:

Input and Output (IO)

Adam Meyers

New York University

Intro to: Computers & Programming:

Loops in Python

V22.0002-001

Summary

? What is Input and Ouput?

? What kinds of Input and Output have we covered so far?

C print (to the console)

C input (from the keyboard)

? File handling

C input from files

C output to files

C Text files vs. 'pickled' binary files

? URL handling

Intro to: Computers & Programming:

Loops in Python

V22.0002-001

Input

? Input is any information provided to the program

C Keyboard input

C Mouse input

C File input

C Sensor input (microphone, camera, photo cell, etc.)

? Output is any information (or effect) that a

program produces:

C sounds, lights, pictures, text, motion, etc.

C on a screen, in a file, on a disk or tape, etc.

Intro to: Computers & Programming:

Loops in Python

V22.0002-001

Types of Input Covered in This Class

? So Far

C Input: keyboard input only

C Output: graphical and text output transmitted to the

computer screen

? This Unit expands our repertoire to include:

C File Input C Python can read in the contents of files

C File Output C Python can write text to files

Intro to: Computers & Programming:

Loops in Python

V22.0002-001

Files

? File = Named Data Collection stored on memory device

C Different types of data: text, binary, etc

C Accessible by name or address

C Has start and end point

C Program can read, created, modified, (and do other things to)

files

? Text file can be treated like a (big) string

C Human readable

C ASCII/UTF-8/etc. encoding

C Can be plain text or can contain markup (e.g., html)

? Binary files: not human readable, usually require specific

programs to read

Intro to: Computers & Programming:

Loops in Python

V22.0002-001

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download