Script to delete unused Empties I have a (big) blender file that contains many empties, and as a result is very slow to work with.

Is there any way to have a python script that deletes objects of type "EMPTY", but only if it's not the parent of any other object?

I found a similar script &lt;here>, but it works with a different  selection criteria..
List comprehension

Every now and then issues occur when removing objects from the collection that is being iterated over. (possibly an issue of the past) Now as a matter of choice I use list comprehension to create the filtered list.

For our filter, an empty has None for its data, and [] for children if none, both of which are boolean false. 

A  popped member is removed until the list is empty.  The bpy.objects.remove(...) has a do_unlink property that has a default of False, setting to True removes the need to unlink from scene(s).

import bpy

childless_empties = [e for e in bpy.data.objects
        if not (e.data or e.children)]

while childless_empties:
    bpy.data.objects.remove(childless_empties.pop(), do_unlink=True)