Actualizar Listbox con Archivos en Cola

Python
def refresh_listbox():
    """Refresh the listbox to display all files in the queue."""
    current_items = file_listbox.get(0, "end")  # Get all current items in the listbox
    queue_items = [os.path.basename(file) for file in list(file_queue.queue)]  # Get all items in the queue

    # Add only new items to the listbox
    for item in queue_items:
        if item not in current_items:
            file_listbox.insert("end", item)  # Append new items to the listbox
Documentación:
Actualiza el widget Listbox para mostrar todos los archivos actualmente en la cola (queue).

- Obtiene todos los nombres de archivo presentes en la cola.
- Verifica cuáles de esos archivos aún no están mostrados en el Listbox.
- Agrega solo los archivos nuevos al final del Listbox para evitar duplicados.

Este método está pensado para usarse cuando se agregan archivos a una cola y se quiere reflejar
visualmente el estado actual en la interfaz gráfica del usuario.