| Course Topics: |
Day 1 AM: Introductions, administrative matters:
Agenda and outline of the course. Goals for the course. Introduction to Python: (1) description of Python; (2) comparison and differences between Python and other scripting languages (Perl, Tcl, etc); (3) comparison with other languages (C, C++, Java, etc); (4) comparison of Python and Jython. Guidance to available on-line resources: http:/www.python.org, the standard Python documentation, SIGs (special interest groups), etc. Lexical matters: (1) variables and names, (2) line structure, (3) comments, (4) block structure, (5) operators.
Day 1 PM: Preview of Python execution model:
(1) how Python evaluates and runs code; (2) the Python object model. Preview of selected statements, for example assignment, print, and for statements. Built-in data types and operations on built-in types: numerical types, lists/arrays, dictionaries, strings, etc. Practical exercises: (1) creating and using tuples and lists; (2) creating and using dictionaries; (3) creating strings, string operations, and formatting strings. ________________________________________
Day 2 AM: Built-in data types, continued:
Practical exercises for built-in data types. Introduction to structured Python: (1) functions, (2) classes, (3) modules, (4) packages. Python statements: (1) assignment, (2) import, (3) print, (4) if-then-else.
Day 2 PM: Python statements, continued:
(1) for; (2) while; (3) continue and break; (4) try-except; (5) raise. Practical exercises -- statements. ________________________________________
Day 3 AM: Python statements, continued:
(1) del, (2) exec and eval(). Structured Python -- functions. Optional parameters and default values; keyword arguments; (multiple) return values; mutable, shared values as arguments. Practical exercises: statements and functions.
Day 3 PM: More structured Python -- modules and packages:
Review of Python execution model. Iterators and generators. Practical exercises: (1) functions; (2) iterators and generators. Structured Python, continued -- Introduction to object-oriented programming, classes, and instances. ________________________________________
Day 4 AM: Object-oriented Python -- Implementing and using classes:
(1) instance variables; (2) constructors; (3) instance methods; (4) inheritance; (5) class variables; (6) class methods and static methods.
Day 4 PM: Exercises and applications with object-oriented Python -- Possible applications:
A vehicle tracking using classes such as Vehicle, Truck (a subclass of Vehicle), BigRig (a subclass of Truck), Route, and Stop (where a Route has a collection of Stops). Scanning files using regular expressions with (1) a class that provides a prompt and a command line interface and (2) a class that delegates scanning operations to the regular expression pattern class. Wrapper classes for the file class/type. ________________________________________
Day 5 AM: The Python standard library -- A review of some significant modules:
Practical exercises -- Using the Python standard library. Possible tasks and exercises: Running system commands from Python using os.system(), os.popen*, etc. Regular expression search and replacement -- the re module. Working with paths, filenames, files, etc. -- the os module, os.path, glob, etc.
Day 5 PM: Advanced topics -- A summary:
(1) Embedded Python. (2) Extended Python; extending Python in other languages (SWIG, Pyrex, etc). Comparison with equivalent tasks for Jython. (3) Database access with the Python DB API. (4) XML processing in Python. (5) Comma separated values (CSV). Etc. Application area practical exercises -- Application related tasks and problems suggested by class members. Possible topics and exercises: XML processing in Python Database access with Python Text processing in Python, possibly including the use of the CSV (comma separated values) module Advanced data structures in Python -- Possible topics: trees and annotated trees; search-able data structures; RDF (resource description framework), etc. |