Get Selected Object (begginer question)

if i want to get the selected/active object what function do i have to use.
eg.
obj = get selected mesh
what do i have to type instead of the “get selected mesh” to get te equation work?

thanks in advance

import bpy
sce = bpy.data.scenes.active
ob_act = sce.objects.active

this will give me an error
no module named bpy

install blender 2.44

import Blender
Blender.Object.getSelected?
I’m sure it was something like that…

both of these functions give me the name of the active object, but i cannot assign the name to a variable eg.obj. I need to get a selected Mesh object.

Sorry, I’m not entirely sure what you mean…:o
Couldn’t you assign the name to a variable by just doing “[variable] = Blender.Object.getSelected()”?

no it doesnt work
it does get me the name of the selected object, but i cannot edit or acces the data of the object.
for example
obj = Blender.Object.getSelected()
print obj.verts
then ill get error saying that objects dont have verts.
i need a selected mesh
obj_name= Blender.Object.getSelected()
print obj_name ----eg. Plane.001
then obj = Mesh.Get(obj_name)
but that wont work either
i also tried this

Blender.Object.GetSelected() is a liost of objects, and youll need to access the objects data to deal with verts.

sel = Blender.Object.GetSelected()
if sel: obj = sel[0]

assuming this worked and its a mesh

me = obj.getData(mesh=1)
print me.verts