PyMOTW: mailbox

The mailbox module defines a common API for accessing email messages stored in local disk formats, including Maildir, mbox, MH, Babyl, and MMDF. There are base classes for Mailbox and Message, and each mailbox format includes a corresponding pair of subclasses to implement the details for that format. Read more at pymotw.com: mailbox

Apache rewrite rule with back-reference in the regex

This might be obvious, but it took me a little while to work it out so I’m documenting it here for posterity. I recently rearranged some of the files in the PyMOTW section of my site, renaming PyMOTW/atexit/atexit.html to PyMOTW/atexit/index.html for example. I wanted to create an Apache RewriteRule to fix all of the references to those pages, but didn’t want to list them all manually. I ended up with this rule:

PyMOTW: imaplib

imaplib implements a client for communicating with Internet Message Access Protocol (IMAP) version 4 servers. The IMAP protocol defines a set of commands sent to the server and the responses delivered back to the client. Most of the commands are available as methods of the IMAP4 object used to communicate with the server. Read more at pymotw.com: imaplib

The Hazel Tree

Gerard Flanagan is working on a “Python compendium” over at http://www.thehazeltree.org/. He is converting a whole slew of Python-related reference material into reStructuredText and then building a single searchable repository from the results. I am very pleased to have PyMOTW included with works from authors like Mark Pilgrim, Fredrik Lundh, Andrew Kuchling, and a growing list of others. Have a look at what Gerard has put together so far, and give him some feedback.

PyMOTW: anydbm (and related modules)

anydbm is a front-end for DBM-style databases that use simple string values as keys to access records containing strings. It uses the whichdb module to identify dbhash, gdbm, and dbm databases, then opens them with the appropriate module. It is used as a backend for shelve, which knows how to store objects using pickle. Read more at pymotw.com: anydbm

PyMOTW: exceptions

In the past, Python has supported simple string messages as exceptions as well as classes. Since 1.5, all of the standard library modules use classes for exceptions. Starting with Python 2.5, string exceptions result in a DeprecationWarning, and support for string exceptions will be removed in the future. Read more at pymotw.com: exceptions

Releasing Software

“Release early, release often.” How often is enough and does it count if you just commit? I’ve always been interested in development processes and how they impact the software being created. I have worked in shops with a range of formal processes, and after some experimentation with different methodologies, I find myself most comfortable somewhere in the middle of the spectrum. I like to have enough controls in place to understand how forward progress is made and prevent regressions, but also want a certain degree of flexibility to bend the rules when the situation calls for it.

PyMOTW: profile, cProfile, pstats

The profile and cProfile modules provide APIs for collecting and analyzing statistics about how Python source consumes processor resources. Read more at pymotw.com: profile

Python Magazine for August 2008

The August 2008 issue of Python Magazine is available for download now. The cover story this month is from Greg Pinero and talks about http://www.utilitymill.com/. If you don’t know about Utility Mill, you should check it out. I don’t think there’s an easier way to create a web utility. Greg explains some of the security and performance issues he encountered creating the site and walks you though posting your own app.

PyWorks 2008 Conference Schedule

Brian has posted the schedule for PyWorks 2008. He has put together a good mix of topics, including the cross-over with the php|works side of the conference. The presenter list includes some familiar names, and some new ones, too. Now if I could only figure out how to be in 2 places at the same time, so I could listen to Kevin Dangoor talk about ZODB and Jacob Taylor’s presentation on artificial intelligence.