scripted rotation of group

Hi,
I have created a group of meshes which I would like to scale and then rotate around the origin using python scripting. Rotating and scaling the whole group works fine using the S and R key, but it is pretty unprecise. Rotating and scaling single objects is easy but I cannot find how to do this with the whole group (especially because I do not want to rotate each obect around its own axis but rather around the origin of the group which I set to (0,0,0))
Thank you very much for your help

You can use the “bpy.ops” to have a script do anything you can do with the mouse and keyboard.

For example, if you select all your object then do “bpy.ops.transform.rotate(…)” it will rotate the selected objects the same way that the mouse does.

‘bpy.ops.transform.rotate’ takes a long list of parameters so you should be able to get it to do whatever you want.

bpy.ops.transform.rotate(value=(0,), axis=(0, 0, 0), constraint_axis=(False, False, False), constraint_orientation=‘GLOBAL’, mirror=False, proportional=‘DISABLED’, proportional_edit_falloff=‘SMOOTH’, proportional_size=1, snap=False, snap_target=‘CLOSEST’, snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)