NOTE: in the spirit of the dynamic nature of Python, the Syllabus (and the class) will be a dynamic document -- evolving as the class progresses. The general structure is fixed, but the details will change.
Christopher Barker, PhD. (PythonCHB@gmail.com) is an oceanographer and software developer currently working for NOAA in Seattle. He first began programming over 30 years ago, and has been using programming to solve problems in science and engineering ever since. He has been using Python as his primary language since 1998. Chris gives numerous presentations on his work at professional conferences, and teaches oceanography and oil spill modeling at regular workshops. He has been involved with the Seattle Python Interest Group (www.seapig.org) for many years, and has given a number of talks and tutorials at SEAPIG meetings, as well as the PyCon and Scipy conferences. He is an active participant in a number Python-related open source communities, and has served as a Google Summer of Code mentor for the wxPython project.
There are two main supported versions of Python: the 2.* series and the 3.* series (py3k). In this class we will be using "cPython" version 2.7, the version distributed by python.org. Each student is expected to have access to a computer with python 2.7 and a decent programmers text editor installed, both during class and for homework assignments. Any modern Operating sytem is fine: OS-X, Linux, or Windows.
This class assumes a basic knowledge of programming. Thus I will try to emphasize what is unique about Python, with less focus on general programing concepts.
One learns programming by doing -- I'll be demonstrating as I talk about concepts, and I will pause frequently to give you a chance to try things out, so plan on having a laptop up and running with python and your text editor of choice during each class.
There will generally be weekly homework assignments. They will usually be flexible to allow for students' varying time constraints. However, you learn by doing, so I do encourage you to put some time in to the homework. I will review your work if you ask me to, and do a mini code-review of selected assignments during class.
Teach Yourself Programming in Ten Years
In addition, I will ask each student to identify a small project, ideally related to your work, that you can develop as a class project -- that project will be the primary homework for the last few classes.
Each student is expected to give one "lightning talk" during the class -- this is a simple 5-minute talk on something related to Python -- totally up to you. We will randomly assign the talks schedule (using Python, of course) during the first class.
Each class will be broken down something like this:
- 30 minutes talk
- 25 minutes lab time
- 5 minute lightning talk
- 5 minute lightning talk
- 20 minutes talk
- 30 minutes lab time
- 5 minute lightning talk
- 5 minute lightning talk
- 20 minutes talk
- 30 minutes lab time
(there will be no official breaks, but we should all feel free to move about during lab/exercise time)
All class materials will be up on gitHub (where you probably found this). This allows me to update things at the last minute, and the students can all have easy access to the latest versions. It also familiarizes you with a very useful tool for software development. We'll spend a bit of time during the first class getting everyone up and running with git....
https://github.com/UWPCE-PythonCert/IntroToPython
for rendered and ready to read version:
http://UWPCE-PythonCert.github.io/IntroToPython
There is no assigned text book. However, you may find it beneficial to read other discussions of topics in addition to what I present in class: either to explore a topic more deeply, or to simple get another viewpoint. There are many good books on Python, and many more excellent discussions of individual topics on the web. A few you may want to consider:
- The Python Tutorial (https://docs.python.org/2/tutorial/): This is the official tutorial from the Python website. No more authoritative source is available.
- Code Academy Python Track (http://www.codecademy.com/tracks/python): Often cited as a great resource, this site offers an entertaining and engaging approach and in-browser work.
- Learn Python the Hard Way (http://learnpythonthehardway.org/book/): Solid and gradual. This course offers a great foundation for folks who have never programmed in any language before.
- Dive Into Python 3 (http://www.diveinto.org/python3/): The updated version of a classic. This book offers an introduction to Python aimed at the student who has experience programming in another language.
- Python for You and Me (http://pymbook.readthedocs.org/en/latest/): Simple and clear. This is a great book for absolute newcomers, or to keep as a quick reference as you get used to the language.
- Think Python (http://greenteapress.com/thinkpython/): Methodical and complete. This book offers a very "computer science"-style introduction to Python. It is really an intro to Python in the service of Computer Science, though, so while helpful for the absolute newcomer, it isn't quite as "pythonic" as it might be.
- Core Python Programming (http://corepython.com/): Only available as a dead trees version, but if you like to have book to hold in your hands anyway, this is the best textbook style introduction out there. It starts from the beginning, but gets into the full language. Published in 2009, but still in print, with updated appendixes available for new language features.
- Python 101 (http://www.blog.pythonlibrary.org/2014/06/03/python-101-book-published-today/) Available as a reasonably priced ebook. This is a new one from a popular Blogger about Python. Lots of practical examples. Also avaiable as a Kindle book: http://www.amazon.com/Python-101-Michael-Driscoll-ebook/dp/B00KQTFHNK
- Python Essential Reference (http://www.dabeaz.com/per.html) The definitive reference for both Python and much of the standard library.
... and many others
General Introduction to Python and the class. Using the command interpreter and development environment. Finding and using the documentation. Getting help. Class github project. Basic data types, functions.
More on functions: definition and use, arguments, block structure, scope, recursion
Modules and import
Conditionals and Boolean expressions
Sequences: Strings, Tuples, Lists
Iteration, Looping and control flow.
String methods and formatting
Dictionaries, Sets and Mutability.
Exceptions.
Files and Text Processing
Unicode.
Advanced Argument passing
List and Dict Comprehensions
Testing
Lambda and Functional programming.
Object oriented programming. Classes, instances, and methods
More OO -- Inheritance and duck typing
More OO: Special methods
Iterators and Generators
Decorators
Context Managers
Packages and packaging
Persistence / Serialization