change active object

Hello to all.
I am programming a script for Blender 2.5 and I need to change the active object in the scene.
How can I do? :confused:
Thanks.

For example, if you want select an object named “Lamp”:

 
import bpy
for obj in bpy.data.objects:
    if obj.name=="Lamp":
        obj.select=True

Edit: oops Active not select…