Computer Sciences Department logo

CS 368-2 (2012 Spring) — Introduction to Scripting for CHTC

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


Dates March 12 (Monday) through May 9 (Wednesday) — 8½ weeks
Times TuTh 1:20–2:10 p.m.
Location Computer Sciences 1289
Instructor Tim Cartwright : CS 4265 : cat [@] cs [.] wisc [.] edu
Mailing List compsci368-2-s12-hhh [@] lists [.] wisc [.] edu

Office Hours

Mondays, 3–4 p.m. and Fridays, 11 a.m. – noon 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:

If you really want to buy a physical book, there are many books on Python. The Learning Python book, cited above, is fine. I have personally looked at the following book and thought it looked OK, too; plus, it focuses on teaching the basics of computing and programming along the way, so it is aimed at new programmers. However, I make no recommendations for purchasing a book.

Introduction to Computing Using Python: An Application Development Focus by Ljubomir Perkovic. ISBN 978-0-470-61846-2. Wiley, December 2011.

If you are new to programming or using the command line, I wrote a few pointers to get started. For more advanced students, I wrote a basic page on writing unit tests in Python.

Also, check out the other CS 368 sections for the 2012 Spring semester:


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


# Day Topic Reading Slides Homework
1 March 13 (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: Numeric Types
Ch.7: Strings
PDF homework
2 March 15 (Thu) More Basic Syntax Ch.6: The Dynamic Typing Interlude
Ch.10: Introducing Python Statements
Ch.11: Assignments, Expressions, and Prints
Ch.12: if Tests and Syntax Rules
Ch.13: while and for Loops [just while loops today]
PDF homework
3 March 20 (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 March 22 (Thu) I/O and Exceptions Ch.9: Tuples, Files, and Everything Else [just Files]
Ch.32: Exception Basics
PDF homework
5 March 27 (Tue) Data, Functions, and Classes Ch.16: Function Basics
Ch.17: Scopes
Ch.18: Arguments
Ch.25: OOP: The Big Picture [optional]
PDF homework
6 March 29 (Thu) Modules and the Standard Library Ch.21: Modules: The Big Picture
Ch.22: Module Coding Basics
Python (2.4.3) Global Module Index
PDF homework
7 April 10 (Tue) Regular Expressions Python module re (link is for 2.4.3)
[Very advanced:] Mastering Regular Expressions
PDF homework
8 April 12 (Thu) System Interaction Python modules (links are for 2.4.3):
os, sys, getopt, optparse, subprocess
PDF homework
9 April 17 (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 April 19 (Thu) 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 April 24 (Tue) Workflows with DAGMan Condor 7.7 Manual:
Chapter 2: Users’ Manual (skim section 2.10)
PDF homework
12 April 26 (Thu) Scripting Workflows I: Parameter Sweeps PDF homework
13 May 1 (Tue) Scripting Workflows II: DAGMan PDF homework
14 May 3 (Thu) Wrapper Scripts PDF homework
15 May 8 (Tue) Writing Scientific Code in Python PDF