In Part 4 we made our first poetry client that uses Twisted. It works pretty well, but there is definitely room for improvement.
First of all, the client includes code for mundane details like creating network sockets and receiving data from those sockets. Twisted provides support for these sorts of things so we don’t have to implement them ourselves every time we write a new program. This is especially helpful because asynchronous I/O requires a few tricky bits involving exception handling as you can see in the client code. And there are even more tricky bits if you want your code to work on multiple platforms. If you have a free afternoon, search the Twisted sources for “win32” to see how many corner cases that platform introduces.
Sterling is the best sort of futurist. Neither wide-eyed with wonder, nor sounding the drumbeat of doom, he just seems to geniunely want to figure out what is coming next. And he’s funny, too.
The serial tragedy of Roy Hobbs, a gifted baseball player beset by circumstance and character flaws. I never saw the movie, but I suspect they are only loosely related.
A crisp and readable introduction to relational database theory for practitioners, and an entertaining polemic against the current crop of relational database systems and SQL.
Although Twisted is probably more often used to write servers, clients are simpler than servers and we’re starting out as simply as possible. Let’s try out our first poetry client written with Twisted. The source code is in twisted-client-1/get-poetry.py. Start up some poetry servers as before:
Eventually we are going to re-implement our asynchronous poetry client using Twisted. But first let’s write a few really simple Twisted programs just to get the flavor of things. As I mentioned in Part 2, I developed these examples using Twisted 8.2.0. Twisted APIs do change, but the core APIs we are going to use will likely change slowly, if at all, so I expect these examples to work for many future releases. If you don’t have Twisted installed you can obtain it from the Twisted downloads page.
A fine collection of r.crumb drawings of blues and country musicians from the 20’s and 30’s. Each sketch includes a short bibliography and the book comes with a CD of selected music.