ICS 32A Fall 2023
Schedule


In lieu of a course textbook, assigned readings are mainly the Notes and Examples from lecture. It is a good idea to skim the assigned reading before the lecture for the main ideas, attend lecture, and then to go through the assigned reading again to fill in the details that you missed, both in your initial skim of the reading and in the lecture.

Date Lecture Topics Readings Project Work
Week 0
Lectures
  • Course introduction
  • What is Python?
  • What are software libraries?
  • Designing and writing larger programs (briefly)
  • Launching a Python shell
  • Expressions and evaluation
  • Types, objects, numbers, and operators
  • Variables
  • Values have types; variables do not
  • Naming conventions
  • Statements
  • Booleans
  • Writing Python scripts
  • Printing output and reading input
Week 1
Lectures
  • Strings
  • Conversions between types
  • Conditionality using the if statement
  • Truth testing and "truthiness"
  • Repetition using the while loop
  • Ranges
  • Iteration using the for loop
  • Abstraction
  • Writing functions
  • Parameters and arguments
  • Type checking and type errors
  • Scope and scoping rules
M 10/2
  • Lab sections begin meeting today
  • Project 0A due 11:59pm
F 10/6
Week 2
Lectures
  • Built-in data structures in Python
  • Tuples
  • Lists
  • Type annotations (briefly)
  • Files and the built-in open function
  • Why it's important to close files
  • Higher-level file access
  • File systems and related modules in Python's standard library
  • Paths
  • Exceptions and exception handling
  • try statements
  • try, except, else, and finally clauses
F 10/13
Week 3
Lectures
  • Testing
  • Categories of test cases
  • Automation of testing using the assert statement
  • Recursive data structures
  • File systems as a recursive data structure
  • Recursive functions
  • When recursion is — and is not — appropriate in Python
  • Python programs that span multiple files
  • Modules and the import statement
  • Namespaces (briefly)
  • if __name__ == '__main__'
Videos
  • Overview of computer networks (briefly)
  • Network input and output
  • Some necessary background on how the Internet works
  • IP addresses, ports, packets, routers, etc.
  • Sockets
  • A socket's input and output streams
  • Servers and clients
  • Using sockets in Python
  • Bytes vs. strings (briefly)
  • An example Python socket "echo" client
  • Using "pseudo-file" objects to treat socket input/output as text
F 10/20
Week 4
Lectures
  • Namedtuples
  • Sets
  • Dictionaries
  • Network protocols
  • The importance of knowing who and what to trust
  • Public and protected functions in a module
  • Implementing a custom text-based protocol in Python
  • More details about import and multiple modules
  • Naming conventions for modules
M 10/23
F 10/27
Week 5
Lectures
  • Why namedtuples are a limited way to create new kinds of objects
  • Classes
  • Objects and their attributes
  • Constructors, initialization, methods, and the self parameter
  • The difference between method calls and function calls
  • Why we specify some parts of a class as public and others as private
  • Naming conventions for classes
  • More about classes
  • Duck typing
  • Interfaces
  • Consistently designing multiple similar classes
  • Using objects of multiple similar classes without explicitly knowing their types
F 11/3
Week 6
Lectures
  • Pushing out the boundaries even further: the web
  • URLs
  • HTTP
  • GET requests
  • Writing a Python program that downloads a web page given its URL
  • Why standards are so important on the Internet
  • Why HTTP is for more than just web browsers
  • Web APIs
  • URLs with query parameters
  • URL encoding (briefly)
  • JSON (JavaScript Object Notation), and why it matters even if you're not writing JavaScript
  • Using Python's standard library to access web APIs
M 11/6
F 11/10
  • University Holiday: Veterans' Day — NO LABS TODAY
Week 7
Lectures
  • Objects, references, and id
  • Multidimensional data
  • Multidimensional list algorithms
  • Test-driven development
  • Unit tests as a way of improving one's design
  • Refactoring (briefly)
  • The unittest module in the Python standard library
  • When Python's standard library falls short
  • Why we need third-party libraries
  • Installing third-party libraries
  • Virtual environments
M 11/13
F 11/17
Week 8
Lectures
  • What libraries we might need if we want to implement games
  • Writing a visual game in Python
  • Getting started with PyGame
  • Displays and surfaces
  • The game loop
  • Events
  • Colors
  • Drawing and animation
M 11/20
Th 11/23
  • University Holiday: Thanksgiving — NO LECTURE TODAY
F 11/24
  • University Holiday: Thanksgiving — NO LABS TODAY
Week 9
Lectures
  • Clocks
  • The "Spots" game, using PyGame
  • Models and views
  • Keeping model and view code separate
  • Handling additional kinds of events
  • Using modules and classes to improve our design
  • The fractional coordinate system
  • Two-way coordinate conversions
  • Augmenting our games with additional features
  • Two ways of handling keyboard input
  • Mixers and generating sound
W 11/29
F 12/1
Week 10
Lectures
  • Graphical user interfaces
  • The tkinter module in the Python standard library
  • Event-based programming
  • Creating a window and letting tkinter manage it
  • Widgets
  • Behaviors and events
  • Buttons, commands, and event handler functions
  • Bound methods in Python
  • The grid layout manager
  • Model/view separation in a tkinter application
  • Applying test-driven development to a "real" project
  • Why model/view separation makes testing better
W 12/6
F 12/8
Finals Week
Th 12/14
  • FINAL EXAM: 4:00pm-6:00pm, BS3 1200