How do one apply a modifier?

How do I apply a modifier by python in blender 2.5?
I don’t get this:


if you check the arrays sketch script, it apply’s modifiers,
sorry, in a rush, but we found the code there recently.

Thank you Meta-Androcto!
For everyone else who would like to know how to apply a modifier in blender 2.5:
bpy.ops.object.convert(target=‘MESH’, keep_original = False)

Exporters use create_mesh() at the moment and you can even get modifier_apply() to work with custom py-context. Both ideasman and theeth said the latter one is not a good thing to do though, so it’s probably better to not elaborate this further right now. :wink:

hehe OK so I stick with my solution atm. One more question: How do I loop thru a objectgroup?
I tried this:
for Shard in[‘Shards’]:
But failed…