Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Following exec_run output in realtime #2556

Open
drgibbon opened this issue May 6, 2020 · 1 comment
Open

Following exec_run output in realtime #2556

drgibbon opened this issue May 6, 2020 · 1 comment

Comments

@drgibbon
Copy link

drgibbon commented May 6, 2020

Probably a basic question, but is it possible to have the output of exec_run hitting stdout in real time? For example, if I do: x = container.exec_run(cmd = "find / -type f") I can get the output after the command finishes with: print(x.output.decode('utf-8')), but is it possible to have it output in real time instead?

@datashaman
Copy link

From what I've seen Python processes usually benefit from having PYTHONUNBUFFERED=1 set in the environment for this problem.

https://stackoverflow.com/questions/107705/disable-output-buffering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants