Python

Using Python to Reduce the Roaming Profile

Roaming Profiles are a blessing and a curse. If the user uses the internet, their browser’s cached files will grow like mad. If the user downloads programs to their desktop or creates large Powerpoint files anywhere in their profile, then they have to be managed whenever the user logs in or out. There are several […]

Using Python to Reduce the Roaming Profile Read More »

Enabling Screen Locking with Python

A few months ago, my employer needed to lock down some of our workstations to be compliant with some new software we were installing from another government organization. We needed to force those machines to lock after so many minutes elapsed and we needed to make it such that the user could not change those

Enabling Screen Locking with Python Read More »

Another Step-by-Step SqlAlchemy Tutorial (part 2 of 2)

In the first part of this series, we went over what some might call the “SQL Expression” method of using SqlAlchemy to interact with your database. The theory behind this is that we should learn the less abstract way of doing things before we get to the higher level (and more abstract) methods. This is

Another Step-by-Step SqlAlchemy Tutorial (part 2 of 2) Read More »

Another Step-by-Step SqlAlchemy Tutorial (part 1 of 2)

A long time ago (circa 2007 if Google serves me right), there was a Python programmer named Robin Munn who wrote a really nice tutorial on SqlAlchemy. It was originally based on the 0.1 release, but updated for the newer 0.2. Then, Mr. Munn just disappeared and the tutorial was never updated. I having been kicking around the idea of releasing my own version of this tutorial for quite some time and finally decided to just do it. I hope you will find this article helpful as I found the original to be.

Another Step-by-Step SqlAlchemy Tutorial (part 1 of 2) Read More »

A Brief ConfigObj Tutorial

Python comes with a handy module called ConfigParser. It’s good for creating and reading configuration files (aka INI files). However, Michael Foord (author of IronPython in Action) and Nicola Larosa decided to write their own configuration module called ConfigObj. In many ways, it is an improvement over the standard library’s module. When I first looked

A Brief ConfigObj Tutorial Read More »

Using Multiple Databases in TurboGears 2

Last week, I embarked on an adventure into the world of web application programming. Since my work place uses Python as much as possible and my boss likes TurboGears, I chose it for this endeavor. I have worked through various TurboGears tutorials and thought it looked pretty cool. However, it doesn’t take long to discover

Using Multiple Databases in TurboGears 2 Read More »

wxPython – Redirecting stdout / stderr

New programmers start using Python and wxPython each week. So it follows that every few months, I see people asking how to redirect stdout to a wx.TextCtrl on comp.lang.python or the wxPython mailing list. Since this is such a common question, I thought I would write an article about it. Regular readers will know that

wxPython – Redirecting stdout / stderr Read More »