Archive for the ‘Tutorial’ Category

So I was just browsing some code, and I came across a cool module I’d never seen before: glob. Basically, it has two functions that either return a list or an iterator of files in a directory using shell pattern matching. So, for example, to return a list of all jpg files in a directory: […]


So unfortunately, the guy who developed libgmail has stopped upkeep, and most likely, the version you have is defunct. HOWEVER: There is an updated version of libgmail. Share and enjoy. I was working on a project once where I needed to download some Google Alert e-mails from a Gmail account and automatically download and organize […]


One of Python’s many strengths is its large library of modules. OK, so you may not be able to fly (well, maybe with that medicine…), but you can import antigravity now. It just opens up a Web browser with that comic in it. In any case, what does this have to do with processing a […]


The Internet is a bit like a giant database. There’s information and data strewn about, distributed all over the world, and we run queries on the data using tools like Google. Many different sites put out constantly updated, useful information, like US gas prices. The problem is that they don’t all supply APIs and XML […]


I work with a lot of files at the Alligator, mostly because our CMS is retarded, but we’d end up having a ton of files either way. In any case, I find that a lot of times, the photo department doesn’t end up naming the files how I want them — they should be prefixed […]


Note: This post contains errors. I’m quite sorry, but see my correction post on the difference between floating-point and integer math for details. Sometimes when you’re sitting at a computer you need to hammer out a quick calculation. Despite not being a huge math fan, I find this to be true more often than I’d […]


When I first started with Python, I noticed that it had a built-in utility for parsing XML. After using regular expressions to rip through XML files as chunks of structured text (not a fun experience), I thought it would be an interesting idea to attempt it in Python using the built-in minidom parser. As a […]