def main(key):
    'Delete key and all empty parent keys.'
    Tkinter.Tk().withdraw()
    try:
        key, parent = delete(*key.rsplit('\\', 1))
        while empty(parent):
            key, parent = delete(*key.rsplit('\\', 1))
        tkMessageBox.showinfo('Info', 'Uninstall passed!')
    except:
        tkMessageBox.showerror('Error', traceback.format_exc())
Delete key and all empty parent keys.
recipes/Python/510395_KRMKv3__uninstallpy/recipe-510395.py