Looking for examples of tty / using subprocesses correctly in python #97
Unanswered
gwenwindflower
asked this question in
Q&A
Replies: 3 comments 5 replies
|
Happy to add some docs/an example too once I get it, I do Developer Experience work for a living, so I write a lot of docs and such. |
0 replies
|
The tty allows you to run interactive terminal apps in a sunbeam extension (ex: an editor). It allows your script to gain control of the terminal (stdin/stdout and stderr are interactive). Example usage in python would be: test = subprocess.run(
["dbt", "test", "-s", node_name], stdin=subprocess.Pipe, stdout=subprocess.Pipe, stderr=subprocess.Pipe
) |
4 replies
|
I see. You will be able to see the logs, but they will be hidden as soon as the command exit. I'm still searching for a good way to handle this usecase. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
attempting to run a terminal command and ideally get an interactive/streaming response back, which my intuition says should be a 'tty' type command, but can't find any examples of the expected type to return in the JSON.
in the interim trying to do it with 'detail' type,
this works but i can't figure out how to introspect it and work from here. any tips on using the tty type? am i right about what it's for?
All reactions