Output messages from for loop while callback running


I have a UI with a button that runs a heavy process in the background. The main function has a for loop in which I can print the loop number and see it in the console, but I would like to present this to the user as well. Is there a way to print the progress of a callback?

I have checked the css loading state solution but is not really helpfull when a computation might take up to 30min.

Thanks in advance,

It isn’t. The best solution to this would be for the client to ping the backend periodically (using the dcc.Interval component). See Boilerplate Heroku Dash App for Long Processes (show and tell) - #4 by astautz for one approach created by a community member.

Thank you very much for your reply. :slight_smile:
I will try to implement the suggested example.

Thank you for the great framework as well.

1 Like