Computer Sciences Department logo

CS 368-4 (2011 Fall) — Introduction to Scripting for CHTC

Offered by the University of Wisconsin–Madison, Department of Computer Sciences.


Dates October 24 (Mon) through December 15 (Fri) — eight weeks
Times TuTh 1:20–2:10 p.m.
Location Computer Sciences 1257
Instructor Tim Cartwright : CS 4265 : cat [@] cs [.] wisc [.] edu
Mailing List compsci368-4-f11-hhh [@] lists [.] wisc [.] edu

Office Hours

Mondays, 3–4 p.m. and Thursdays, 3–4 p.m. in CS 4265 (my office).

You can also make an appointment (by email is probably best) to talk to me. I work full time here in the CS building, so will often be available. However, dropping by my office without an appointment is not guaranteed to work.

Course Books & Other Resources

There are no books to buy for this course. There is a Python book that I suggest using, and it is available for free online through the UW library system. Also, there are plenty of good resources available online. Here are a few (including the book) to get started:

Also, I wrote a few pointers for students who are new to programming.

Also, check out the other CS 368 sections for the 2011 Fall semester:


Slides, code samples, and homework assignments are posted on the day of the corresponding class. All reading assignments are from Learning Python (3rd Ed.), unless otherwise as indicated by a hyperlink.


# Day Topic Reading Slides Code Homework
1 October 25 (Tue) Overview & Python Basics Ch.1: A Python Q&A Session [skim]
Ch.2: How Python Runs Programs [optional]
Ch.3: How You Run Programs
Ch.4: Introducing Python Object Types [overview]
Ch.5: Numbers
Ch.7: Strings
PDF homework
2 October 27 (Thu) More Basic Syntax Ch.6: The Dynamic Typing Interlude
Ch.10: Introducing Python Statements
Ch.11: Assignment, Expressions, and print
Ch.12: if Tests
Ch.13: while and for Loops [just while loops today]
PDF homework
3 November 1 (Tue) Collections Ch.8: Lists and Dictionaries
Ch.9: Tuples, Files, and Everything Else [just Tuples]
Ch.13: while and for Loops [for loops]
PDF homework
4 November 3 (Thu) I/O and Exceptions Ch.9: Tuples, Files, and Everything Else [just Files]
Ch.27: Exception Basics
PDF homework
5 November 8 (Tue) Data, Functions, and Classes Ch.15: Function Basics
Ch.16: Scopes and Arguments
Ch.22: OOP: The Big Picture [optional]
Ch.23: Class Coding Basics [skim]
Ch.24: Class Coding Details [skim]
PDF code homework
6 November 10 (Thu) Modules and the Standard Library Ch.18: Modules: The Big Picture
Ch.19: Module Coding Basics
Python (2.4.3) Global Module Index
PDF homework
7 November 15 (Tue) Regular Expressions Python module re (link is for 2.4.3)
[Very advanced:] Mastering Regular Expressions
PDF code homework
8 November 17 (Thu) System Interaction Python modules (links are for 2.4.3):
os, sys, getopt, optparse, subprocess
PDF homework
9 November 22 (Tue) Introduction to CHTC and Condor Jobs Condor 7.7 Manual:
Chapter 1: Overview
Chapter 2: Users’ Manual (at most, 2.1–2.7)
PDF homework
10 November 29 (Tue) More Complex Jobs Condor 7.7 Manual:
Chapter 2: Users’ Manual (at most, 2.1–2.7)
condor_q, condor_status,
condor_submit, condor_prio
PDF homework
11 December 1 (Thu) Workflows with DAGMan Condor 7.7 Manual:
Chapter 2: Users’ Manual (skim section 2.10)
PDF homework
12 December 6 (Tue) Scripting Workflows I: Parameter Sweeps PDF homework
13 December 8 (Thu) Scripting Workflows II: DAGMan PDF homework
14 December 13 (Tue) Wrapper Scripts PDF homework
15 December 15 (Thu) Writing Scientific Code in Python PDF