Terminal - how to finish one terminal.subprocess.run before starting another?

I think it’s run in async?

import panel as pn
pn.extension()

terminal = pn.widgets.Terminal()
terminal.subprocess.run(some_long_running_cmd)
terminal.subprocess.run(a_cmd_that_depends_on_previous)
1 Like

Were you able to find the way to know if the current subprocess completes or not?
I have a use case to create a frontend Panel app to define parameters for a notebook to be executed with papermill.
I want to use Terminal widget to trigger the subprocess and gray out the Execute button meantime papermill executes; once completed, to consume the output generated by executed notebook and response back to the end user.

I found the Terminal documentation and seems the running parameter could be of help.

Luis

1 Like

Hi @lgonzalezsa

Tried to create an example but ran into some issues reported in Issue #5908.

Thanks! will pay attention to the GitHub issue. I am going to switch to Python subprocess module in the meantime and explore how I can render the subprocess output in Panel

1 Like