Programming in Python

Bare facts

[Picture of the textbook]
Instructor
Peter Boothe - email, 346-4436, web, and AIM
Time/Location
9-10:50 MoTuWeTh / 42 LIB
Office Hours
1-2 MoTuWeTh
Credit Hours/Grading
4 Credit hours for a real, live, GPA-affecting grade
Book (optional)
Programming Python (2nd ed.). Last year the book was Learning Python (2nd ed.), and students who purchased both books preferred Programming to Learning. ;-)

Overview

Your grade will be determined by how well you do on the homework (60%) and your final project (40%). Remember that you have to follow the exact interface when output is asked for. Ill formatted output is untestable and will be graded accordingly.

News!

Thu Jun 23 12:54:53 PDT 2005
Here is the file that I used to grade assignment 1.
Mon Jun 20 17:32:53 PDT 2005
So, I mentioned that I would explain about python startup files online instead of in class, because the issue is grotty. If you don't want to deal with these complications, then just use ipython as your python shell for testing out code.

So, you need to set your PYTHONSTARTUP environment variable to the appropriate file (mine is /home/peter/.pythonrc.py) and then you need a file there. My .pythonrc.py might serve as an example, but feel free to edit it to your heart's content.

If you are using OSX and can't get ipython installed, and you have Fink, then you can also apt-get install python-nox and make sure that when you type "python" in your shell that it actually executes /sw/bin/python Then the readline module exists, and you can do all that .pythonrc.py stuff.

Assignments

  1. lots of little functions - Due 5pm Wednesday, June 22nd
  2. higher quality algorithms - Due 5pm Friday, June 24th
  3. text processing - Due 5pm Tuesday, June 28th Wednesday, June 29th
  4. CGI - Due 5pm July 6th (my birthday!)
  5. GUI
  6. Final Project - Due on the last day of class.

Syllabus

Stuff I want to cover, possibly in the order I will cover it:

Syntax
Python Idioms
Text Processing
CGI Programming
GUI Programming
Game Programming
Advanced and pysco-tic stuff
Presentation of Final Projects

Links

http://python.org
The main website for Python.
http://www.python.org/doc/current/tut/tut.html
The official Python tutorial.
http://www.python.org/doc/current/lib/lib.html
All the libraries that come with python are documented here.
http://www.python.org/topics/learn/
The Beginner's Guide to Python
http://diveintopython.org/
Another free (gratis and libre) Python book.
http://greenteapress.com/thinkpython/
A good (and free!) book on Python. Would have been our textbook, but it is a little too introductory.
http://jython.org
A Java implementation of Python.
http://www.onlamp.com/pub/a/python/2004/02/05/learn_python.html
An article on common beginner mistakes from the author of the textbook.
http://fmg-www.cs.ucla.edu/fmg-members/geoff/interfaces.html
How to Create a Good UNIX Interface, by one of my undergraduate advisors.
http://www.norvig.com
The author of the A.I. textbook that our department uses (who also happens to be the guy in charge of search quality at Google) has a website with many python links. Particularly interesting is this.
http://www.paulgraham.com/
If you are just tooling around the web looking for stuff to read, then read everything on this man's website.
http://www.ferg.org/thinking_in_tkinter/
Thinking in Tkinter is the best guide to GUI programming that I have found.

Feedback

If you have any feedback about what is going well and what is going poorly for you, I would love to hear it! Please come and talk to me, send me an email, or if it is something that you are not comfortable signing your name to, you can tell me about it anonymously.

Policies

Late Work

If I haven't started grading the assignments yet, late work is accepted with no penalty. After that it is 10% for every day late. After the assignment has been handed back to everyone, you can't turn it in. All of this can be changed if you get sick or have some kind of emergency. But let me know before you fail to turn in the assignment. If you are wondering whether or not you can still turn it in, you should check this page. Your current assignment looks like this, things with a past-due date that look like this can still be turned in as late work, while things that look like this have already been handed back, so you can't turn them in. If you cannot see what I am talking about, enable CSS in your browser.

Grading

This course is in large part a practicum, which is a fancy Latin way of saying that you will be doing a lot of practice. Thus, if your code doesn't compile (i.e. python refuses to make a .pyc), then the assignment is ungradeable and you get a 0.

After that initial hurdle, life gets a little more fair. The gist of the grade is 2/3 correct code and 1/3 good style. These are not hard numbers, but instead are guidelines for the grader (which is me). Misspellings in your comments and bad grammar in your documentation will drag down your grade, as will hardcoded "magic numbers" and the like. You should understand your algorithm and its implementation, and your code should reflect that understanding, with comments provided to hold the reader's hand through the tricky bits. As a programming language, Python code tends to be very clear, so try not to get in the way of that.

Cheating

You've made it this far. By now you either have enough character not to cheat, or you'll do it anyway. But just in case, let me say it right here: DON'T CHEAT. It is completely unacceptable academically and, on a more personal level, totally pisses me off. Anyone cheating will end up getting prosecuted as much as possible. You'll certainly fail the assignment and get a letter on your record, you'll probably also be assigned a failing grade and being forbidden from dropping the class. Please don't make me do this. Everyone involved hates it. I could spell out a bunch of rules, but they would come down to: do your own work, and be ethical and honest. If you need any refinements on this, please come and see me, I will be happy to talk to you about the specifics of a particular situation. Err on the side of full disclosure - if you talked with someone about how to solve the problem, a little comment noting that fact is the right thing to do. Despite this warning, I have caught people cheating in every class I have ever taught except last year's python class. There's not that many of you, and I'm going to read all of your code. Please don't cheat.

All the code you give to me should be freshly written for this class. Please don't recycle old code, instead write new stuff.

Fun

You should be having it. Python is a fun language to program in!


Questions? Answers!
Valid CSS! Valid XHTML 1.1!