cur.execute("DELETE FROM %s WHERE id = %s", (table, id))
debería ser
cur.execute("DELETE FROM %s WHERE id = %s" % (table, id))
cur.execute("DELETE FROM %s WHERE id = %s", (table, id))
debería ser
cur.execute("DELETE FROM %s WHERE id = %s" % (table, id))