Tentative Schedule

back to Class website

 
Week Start of Week Schedule Assignments
1 Jan. 23 Course Intro; basic unix; python shell vs scripting;
chapter 1 including syntax, runtime and loginc errors
week 1 lab due Mon of week 2
2 Jan. 30 Chapters 2: values,variables, expressions, statements; Chapter 3: functionsweek 2 lab
3 Feb. 6 Chapter 4: booleans,conditionals,input, drawing with GASP week 3 lab
4 Feb. 13 Chapter 5, basic html week 4 lab
5 Feb. 20 Mon=Prez Day (no class), Chapter 6 week 5 lab due Wed, Feb 29, Project 1 assigned
6 Feb. 27 Quiz review, begin Chapter 7, code to print ASCII chart: while and for loop versions,
ASCII chart and code Code Camp Fri 2:15-3:15 pm, 4:45-5:45 pm
week 6 lab due Wed Mar 21
7 March 5 finish Chapt 7, Code Camp 1, Code Camp 1 Solutions
Midterm 1 review Wed, Midterm Fri
Project 1 due Wed
  March 12 Spring Break
8 March 19 Chapter 8 week 8 lab;    Wed 3/28 turn in Quiz6 & 7:
Quiz6 correct exam 1-10; Quiz7 correct exam 11-15
9 March 26 Chapter 9 week 9 lab due Wed Apr 4
10 April 2 Chapter 10, Fri no class (Easter Holiday) week 10 lab due Wed Apr 11, Project 2 assigned
11 April 9 Finish Chapter 10, file reading of a maze, Begin Chapter 11: Recursion week 11 lab due Wed Apr 25  
12 April 16 Exceptions, Midterm 2 review, midterm
Code Camp 2, Code Camp 2 Solutions
Project 3 assigned; Project 2 due Wed
13 April 23 Classes, Objects and Inheritance draw class example
Code Camp B1, option B Assignment2, Code Camp B1 Solutions
 
14 April 30 Classes and methods, Binary Search class for complex numbers, gravitational objects
Code Camp B2, option B Assignment3, Code Camp B2 Solutions
 
15 May 7 Final review, Wed is last day of class
Code Camp B3, Code Camp B3 Solutions
Project 3 Option B last part due Fri
15 con't Sat May 12 Final exam is Sat May 12, 12:30 - 2:30 pm in our classroom  

Some Linux commands:

Assignments and Projects

Week i Assignments are due before midnight on the Mon of week (i+1). Project deadlines are specified when assigned.
The text is the free online text: How to Think Like a Computer Scientist: Learning with Python
Part of your assignment for week 1 (below) is to create a website where you will turn in all of your assignments.
When uploading to your website, copy and paste 1) your answers to questions, 2) runs that demonstrate that your solution is correct, 3) any code you wrote to get your results.
Projects must be documented and tested.

Week 1

Week 2

Code to get input, convert inches to centimeters and output result:
inches = input("Enter the length in inches: ")
cent = 2.54* inches
print inches, " in equals ", cent, " cm"

Function to convert inches to centimeters:
# Returns the number of centimeters that is equal to the number of inches in variable inch
def inchesToCentimeters(inch):
    cm = 2.54* inch
    return cm

Main program that calls the function inchesToCentimeters:
inches = input("Enter the length in inches: ")
cent = inchesToCentimeters(inches)          # this is the function call: note that if the result is not assigned to a variable, it will be discarded
print inches, " in equals ", cent, " cm"

Week 3

Hints on using GASP:
A coordinate is an (x,y) pair, just as in coordinates you used in math.
a list of coordinates contains coordinates separated by commas in a list delimited by square brackets:
    [(20, 120), (70, 160), (120,120)]
For the polygon statement: the first parameter is a list of coordinates, the second is a boolean denoting whether the polygon will be filled, and the third is the fill color:
    coordList = [(20, 120), (70, 160), (120,120)]
    Polygon(coordList, True, color.RED)
To close the graphics window, press any key when the graphics window is the current window, don't click on the X in the menu bar to close the window

An example with pygame (Valentine delivery):
Download these files into your cs110 directory:
ChurchReflectoin5Web_Big.jpg,   flowerGram_small.jpg,   harp.wav
Download and run this python program from the terminal

An example with pyProcessing:
    from pyprocessing import *
    size(500,500)
    line(100,100,400,400)
    rect(10,10,70,150)
    ellipse(200,200,50,50)
    ellipse(300,300,100,50)
    run()

Week 4

You can run python in Eclipse if you install Pydev, an Eclipse Python plugin.
For instructions on how to install Pydev click here.

Week 5

Week 6
Note that due date is out of the ordinary: due Wed March 21.

For project 1 due Wed, March 7, 10pm:
First debug your 2 functions that do not involve the web form:
1. Debug your function that counts CAG repeats in the DNA
2. Debug your function that determines the output depending on the number of CAG repeats. The output includes both the classification and the disease status from the project specification. The easiest way for you to write this function is to return a "tuple" that contains both these values. For example, if there are 2 repeats, your function would execute the line:
return ('Normal', 'Unaffected')
Then catch these return values by assigning them to a tuple in main. Ex:
(classification, status) = < your function call >
Pass them to your string template that displays your disease prediction after your form:
resultString = "Number of repeats is: %s, Classification is: %s, Disease status is: %s"%(numCAGs, classification, status)
The "%s" are replaced by string variables that you pass to the string template. In this example, The first "%s" will be replaced by the contents of string variable "numCAGs", the second "%s" will be replaced by the contents of string variable "classification" and the third "%s" will be replaced by the contents of string variable "status".

It's difficult to debug CGI in a browser.
Instead, debug your CGI program on the command line: at the prompt when you would ordinarily type:
python hunt.py
you can instead type a query string as you would see it as part of the URL after you click submit. For example:
QUERY_STRING="first_name=Patricia&last_name=Francis-Lyon&dna=CAGC" python hunt.py
Python will consider these arguments as if they vame from the URL and the web server, and will render your web page to the terminal.
(Of course, you must use the name of your program in place of hunt.py and you must use your form variables (the name from the input tag) in place of first_name, last_name and dna).

Week 8

Week 9

Week 10

Week 11