Python for Programmers B
Instructor Comment
Hi All. Last week's course was rewarding. I especially liked that we managed to develop a clean python code (and GUI) that overcame our lab's restriction on the number of network shares (though we really should have developed the ftpGetter within the "unittest" framework). All of the source code that we developed together is listed below. As I mentioned at the end of class, I'd very much like to see any interesting Python codes you develop. If you have any questions, please feel free to contact me at darran.edmundson@anu.edu.au.
Source Code
Day 1
- Count occurrences of letters in a phrase.
- Moved core logic into a function.
- Now accepting command line argument.
- Simplest of class definitions.
- Now with a contrived method.
- The robot problem (compare with solution from course A).
- Unit testing of our point class.
- Point class proper.
Day 2
- A real class: defining the problem.
- Our ftpGetter solution, one of many.
- Now iterable with command line usage.
- Simplest wxPython GUI application.
- A GUI wrapper around our FTPGetter.
- Contrived C code to wrap.
- Header file (function prototypes).
- Code to exercise the C code.
- Python wrapper handles type conversions and calling C code.
- The distutils module help to compile up the wrapper.
Python Programming Resources
- Python home page
- The UseNet group comp.lang.python with 162,000 posts archived on Google.
- The PyUnit unit testing framework (import unittest) now comes as part of Python. Unit testing frameworks are available for many languages and are a big part of the Extreme Programming approach to software development.
- Mark Pilgrim's free online book, Dive Into Python.
- Another good Python intro, How To Think Like A Computer Scientist.
- For Python-based web and server frameworks, there is Webware, the powerful but monolithic Zope, Twisted, the mod_python Apache plug-in, etc.
- For scientists, there is Numerical Python (soon to be superceded by the budding Scientific Python).
- The cross-platform GUI framework we looked at was wxPython.
