July 2012

Advanced Python – How to Dynamically Load Modules or Classes

Every now and then you’ll find yourself needing to load modules or classes dynamically. In other words, you’ll want to be able to import a module without knowing ahead of time which one you’re going to import. In this article, we’ll look at two ways to accomplish this feat in Python. Using the __import__ Magic […]

Advanced Python – How to Dynamically Load Modules or Classes Read More »

Python PDF Series – An Intro to metaPDF

While researching PDF libraries for Python, I stumbled across another little project called metaPDF. According to its website, metaPDF is a lightweight Python library optimized for metadata extraction and insertion, and it is a fast wrapper over the excellent pyPdf library. It works by quickly searching the last 2048 bytes of the PDF before parsing

Python PDF Series – An Intro to metaPDF Read More »

Python: A Simple Step-by-Step SQLite Tutorial

SQLite is a self-contained, server-less, config-free transactional SQL database engine. Python gained the sqlite3 module all the way back in version 2.5 which means that you can create SQLite database with any current Python without downloading any additional dependencies. Mozilla uses SQLite databases for its popular Firefox browser to store bookmarks and other various pieces

Python: A Simple Step-by-Step SQLite Tutorial Read More »

wxPython: How to Programmatically Change wx.Notebook Pages

Occasionally I’ll see someone on the wxPython users group ask about how to make the wx.Notebook change pages (or tabs) programmatically. So I decided it was about time I figured it out. Here is some code that works for me: import random import wx ######################################################################## class TabPanel(wx.Panel): #———————————————————————- def __init__(self, parent, page): “””””” wx.Panel.__init__(self, parent=parent)

wxPython: How to Programmatically Change wx.Notebook Pages Read More »

wxPython: Creating Your Own Cross Platform Process Monitor with psutil

This week, I came across a fun Python project named psutil on Google Code. It says it works on Linux, Windows, OSX and FreeBSD. What it does is grab all the running processes and gives you information on them and also gives you the ability to terminate them. So I thought it would be fun

wxPython: Creating Your Own Cross Platform Process Monitor with psutil Read More »