def update_gui(): """Updates GUI by completing all tasks in the main event loop""" while Gtk.events_pending(): Gtk.main_iteration_do(True)