Tag Archives: Python

A better way to search for methods of Python objects

Python’s introspection abilities are quite extensive and useful. They are also well-documented, so I won’t go into the basics here. Check out this article if you need a good overview. N.B.: discussion and code below applies to both methods and … Continue reading

Posted in Programming, Python | Tagged , , | 4 Comments

Catching warnings from the MySQLdb module

The MySQLdb Python module implements the Python DB API for MySQL. I’ve written about its use before. MySQL issues warning messages in a number of circumstances and PEP 249 (which specifies the Python DB API) describes a Warning error message … Continue reading

Posted in Python | Tagged , , | 4 Comments

Checking options with optparse callbacks

optparse is a flexible and powerful module for processing command line options in Python programs. I’ve used it for a while, but I didn’t have much occasion to get into callbacks until recently. A callback here is a user-defined function … Continue reading

Posted in Python | Tagged , , | 2 Comments

Send events to Zenoss from scripts

Working at Zenoss the company, our IT group uses Zenoss the application to monitor our infrastructure. Initially, we setup the needed monitoring for various resources, added thresholds and received email alerts if there were problems. That was all well and … Continue reading

Posted in Programming | Tagged , , , | 10 Comments

Printing tabular data attractively in Python

Have you ever looked for a tool several times, not found what you wanted, then one fine day discover exactly what you were looking for by accident? I had just such an experience… Not too infrequently in command line Python … Continue reading

Posted in Programming | Tagged , , | 4 Comments