CSIS 042: Python Programming

Course Outline and Learning Objectives 

Weeks 1 - 2
Lecture What is Python: scripting languages, interpreted languages and environment, installing, setting up, workflow and first program: "Hello world". Introduction to variables, printing to the screen, reading from the keyboard, and simple loops.

Reading:

prog ch 1
variables ch 2
strings ch 7

pp. 1-20

 
Homework / Lab

Download and install the Python language for the student's appropriate platform.

Type and run "the simplest possible program".

Quiz and problem set

 
Performance Objectives

Students will become familiar with the history of the python language and its place in the catalog of computer languages. Become familiar with the python.org website and the resources and documentation therein.

Demonstrate the ability to get "up and running" with python on one of the major computer operating systems.

 
Weeks 3 - 4
Lecture
  • Types of variables: strings, numbers, booleans, and objects.
  • Reading from the keyboard or a file; writing to a file.
  • Control flow: branching and looping.
  • Data structures: Lists as stacks, queues, sets and dictionaries.

Reading:

fxns ch 3
cond. ch 4
lists. ch 8
dicts. ch 10

 

 
Homework / Lab

Case study #1: Parse and gather statistics from web access logs (or similar text file)

Project assignment #1: Demonstrate variables, looping, and simple lists. Add feature to case study.

 
Performance Objectives

Students will practice using variables to store information.
Use variables to do mathematical calculations and to assemble chunks of text.
Students will use if and for statements to implement branching and looping.

 
Weeks 5 - 6
Lecture Variables: "Everything is an object".
Creating, changing, inspecting, and deleting objects.
Subroutines, modules, functions, and recursion.

Reading

fxns ch 5
iteration ch 6

 
Homework / Lab

Quiz and problem set.
Case study #2: Role playing game, black book, or other interactive text-based problem.
Project Assignment #2: Extend the case study to add or improve a feature.

 
Performance Objectives

Demonstrate the use of built-in functions (the Standard Library) to solve common problems. (For example: sort, filter, join and more.)
Demonstrate the ability to create new functions which accept input and perform a calculation.
Practice using predefined objects in the Python Standard Library and the functions defined by them.

 
Weeks 7 - 8
Lecture More string handling: search and replace using regular expressions.
Library modules: internet access (email, web, and others), mathematics, object persistence

Reading:

strings ch 7
files ch 11

other regex reading

 
Homework / Lab

Case study #3: A web page "scraper" that retrieves stock quotes or similar data
Project assignment #3: Modify scraper to retrieve students' choice of data.
Problem set.
Midterm exam

 
Performance Objectives

Students will gain familiarity with a subset of the built-in tools python provides to address common programming tasks.
Students will differentiate between "solved" tasks with built in solutions and those requiring custom work.

 
Weeks 9 - 10
Lecture Advanced regular expressions and more examples.
Object orientation: modules, classes, instances, inheritance and design.
Documentation and unit testing. Test-driven development.

Reading

classes ch 12, 13, 14

 
Homework / Lab

Case study #4: Gathering / compiling statistics from a gene database, including unit tests. (or similar)
Project assignment #4: Quiz and problem set.

 
Performance Objectives

Students will demonstrate the use of regular expressions to perform a variety of text manipulation tasks.
Ability to construct a "test harness" to prove the correctness of code.
Familiarity with Test Driven Development as a methodology and as a habit.

 
Weeks 11 - 12
Lecture Strategies for large problems: modules, classes and organization.
Standard Library: Performance testing (of code), speed measurements.
Introspection: dir() and examining built-in functions.
   
Homework / Lab

Case study #5: Gather and organize statistics from public mapping (GIS) databases.
Project assignment #5: Compare 2 different approaches to case study #4 by program organization and clarity, execution speed, and complexity. Quiz.
Final project proposal.

   
Performance Objectives

Practice object-oriented programming techniques for organization and simplicity.
Ability to gather information about the python environment by examining existing objects and referring to inline documentation.
Ability to compare and evaluate potential solutions by speed and complexity.
Practice the design and construction of tests for both speed and correctness.

   
Weeks 13 - 14
Lecture Platform specifics: MS Windows, Unix-based, others.
Introduction to 3rd party modules.
Debugging and troubleshooting techniques.
Exception handling.
   
Homework / Lab

Code review of a 3rd party module: overview, description, caveats, and criticisms. Step-through its execution using the debugger.
Quiz.
First draft of final project, including unit tests.

   
Performance Objectives

Students will practice the use of exceptions for error handling.
Demonstrate the use of pdb (python debugger) to 'step' through programs and inspect variables during execution.
Students will relate platform-specific capabilities of python with corresponding compromises.
Distinguish between cross-platform compatibility and platform-specific solutions; debate the tradeoffs of each.
Inspect and evaluate code written by an unknown 3rd party.
Design a solution for a non-trivial project, including unit tests.

   
Weeks 15 - 16
Lecture Real world problem-solving. Question and answer and code review of in-progress final projects.
Overview of advanced features: threading, generators, patterns, functional programming. Where to go from here.
   
Homework / Lab

Quiz and problem set.
Continue work on final projects, progress report on final projects.

   
Performance Objectives

Ability to judge between effective and ineffective code.
Ability to recognize common problems, pitfalls, and mistakes.
Recognize the use of advanced techniques and judge their effectiveness.
Construct a solution to a non-trivial project.

   
Weeks 17 - 18
Lecture Course review.
Project presentations.
   
Homework / Lab

Peer review / code review of student projects.
Final exam.

   
Performance Objectives

Judge the completeness, and correctness of student projects.
Evaluate specific blocks of student code for effectiveness.