Python

Python: Parsing XML with lxml

Last time, we looked at one of Python’s built-in XML parsers. In this article, we will look at the fun third-party package, lxml from codespeak. It uses the ElementTree API, among other things. The lxml package has XPath and XSLT support, includes an API for SAX and a C-level API for compatibility with C/Pyrex modules. […]

Python: Parsing XML with lxml Read More »

Python: Changing Microsoft Office User Initials

A couple of months ago at work, we received a report that a file was locked. The dialog that appeared showed the initials of a user who wasn’t even working for us any more. Thus we discovered an annoying bug that can crop up with Office. Basically, a user is asked by Word or Excel

Python: Changing Microsoft Office User Initials Read More »

Downloading Encrypted and Compressed Files with Python

Earlier this year, I was tasked with creating an application that would download information from our organization’s website using Python. The tricky part was that it would be encrypted, gzipped and the payload would be JSON. Could Python do all that? Well, that’s what I wanted to find out. Now it’s time for you to

Downloading Encrypted and Compressed Files with Python Read More »

Python 101: Introspection

Whether you’re new to Python, been using it for a few years or you’re an expert, knowing how to use Python’s introspection capabilities can help your understanding of your code and that new package you just downloaded with the crappy documentation. Introspection is a fancy word that means to observe oneself and ponder one’s thoughts,

Python 101: Introspection Read More »

How to Find and List All Running Processes with Python

The other day, I was tasked with finding a way to get a list of all running processes on a Windows XP virtual machine. I was also supposed to include information about how much CPU and memory each process used. Fortunately, this didn’t have to be a remote script, but one that could be run

How to Find and List All Running Processes with Python Read More »

Book Preview: Python Graphics Cookbook

This week, I finished editing another book for Packt Publishing. The book’s name is Python Graphics Cookbook by Mike Ohlson de Fine (I think). You may wonder why I don’t know if de Fine is the author. Well, Packt thinks that its Technical Editors shouldn’t know that information. In fact, Packt is so cagey (and

Book Preview: Python Graphics Cookbook Read More »

Reportlab Tables – Creating Tables in PDFs with Python

Back in March of this year, I wrote a simple tutorial on Reportlab, a handy 3rd party Python package that allows the developer to create PDFs programmatically. Recently, I received a request to cover how to do tables in Reportlab. Since my Reportlab article is so popular, I figured it was probably worth the trouble

Reportlab Tables – Creating Tables in PDFs with Python Read More »