How to display the output of long running programs in parallel

Hello everyone!

I’ve created a small Streamlit application that demonstrates how to run multiple “long” programs in parallel, retrieve their standard output and error output, and display them in separate Streamlit areas to track the progress of these programs!

The program is available at the following link: https://longrunningcommand-kxym2jps7nfpwevzp45xt2.streamlit.app/

The solution presented at the end of the application is acceptable but it can only apply to programs with a reasonable output line volume.

I don’t have an acceptable solution for programs with output line volumes in the tens or hundreds of thousands!

Ideally, we would need a Streamlit component like this:

pythonCopy code

content = '.....'
x = st.code(content)
while True:
    contentplus = '....'
    x.extend(contentplus)

To my knowledge, the only way to update a component is to use the x.empty() instruction and then recreate it with the modified version.

This is acceptable for a small volume but unacceptable for a large volume.

1 Like