remove from group script ?

is there a script to help remove from all group for selected objects ?

in tried that in viewport and it does not work in 2.79 !

thanks
happy bl

I found this code snippet



# grouped objects

print("grouped objects are these")
for i in bpy.context.selectable_objects:
	if i.name  in names_of_grouped_objects:
		print(">>>",i.name)
		bpy.data.objects[i.name].select = True



at least I can list which one are part of a group

but how to remove from all groups ?

thanks
happy bl