There are some empty bones that i can't delete and really need to get rid of...

How can i select bones in armature edit mode and delete them by script? maybe this will do the job…

You don’t need to select it:

import bpy

ob = bpy.context.object
assert ob.type == 'ARMATURE'

arma =
bpy.ops.object.mode_set(mode='EDIT') # ensure edit mode

bone = arma.edit_bones['Bone']

# Redraw 3D View manually
# (if already in editmode, deleted bone will still display until next redraw)
for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':