I’ve received several patches for svnbackup.sh recently, and an offer to host an RPM version of the code. I decided it probably made sense to go ahead and open the project up to contributors, so I created a project on code.google.com.
Unfortunately, the name svnbackup was already taken, and svnbackup.sh wasn’t a valid project name. I’m linking from my site to the new project, though, so hopefully the minor name change won’t be too confusing.
Dustin Wax gives us 17 concise tips on How to Write (in a thousand words or less) over at lifehack.org. They are a good reminder of some basic dos and don’ts.
This is a really cool visualization of the commit history of the Python core by Michael Ogawa. His site includes movies for other open source projects, too. It’s very interesting to see the difference in the results caused by variations in the organizational structure of the projects.
code_swarm – Python from Michael Ogawa on Vimeo.
(Via Barry Warsaw on python-dev.)
Ben Finney provided a patch to CommandLineApp convert the names of the module, method, etc. to be PEP8-compliant. Thanks, Ben! These changes are obviously backwards incompatible.
Updated: I botched the packaging for 3.0. Release 3.0.1 includes the test script as well.
Although Python is often used as a cross-platform language, it is occasionally necessary to know what sort of system you’re running on. Build tools obviously need that information, but you might also know that some libraries or external commands have different interfaces on different operating systems. For example, if you are writing a tool to manage the network configuration of an operating system, you can have a portable representation of network interfaces, aliases, IP addresses, etc.
I was recently asked for some advice about Python source code that would serve as a good example of organization, style, and documentation (including comments in the code itself). I had a few suggestions for projects to look at, but I wonder what other people think about the question.
Can you point to a project with source that you would hold up as an example of how to set up a medium to large code base?
The dircache module includes a function for caching directory listings. The main function in the dircache API is listdir(), a wrapper around os.listdir() that caches the results and returns the same list each time it is called with the a path unless the modification date of the named directory changes.
Read more at pymotw.com: dircache
The Cookie module defines classes for parsing and creating HTTP cookie headers. Cookies have been a part of the HTTP protocol for a long time. All of the modern web development frameworks provide easy access to cookies so a programmer almost never has to worry about how to format them or make sure the headers are sent properly. It can be instructive to understand how cookies work, though, and the options available.
Mrs. PyMOTW gave me a copy of Einstein: His Life and
Universe by Walter Isaacson for Christmas last year, and I’ve
finally managed to find time to read it. If you are interested in
history, science, and Einstein in particular, I highly recommend the
book.