# Streaming output
<subtitle>Stream stdout and stderr in real time during command execution. </subtitle>

To stream the results of a command as it executes, pass the `on_stdout`, `on_stderr` callbacks to the `commands.run()` method.

```python
from ucloud_sandbox import Sandbox

sandbox = Sandbox.create()

result = sandbox.commands.run('echo hello; sleep 1; echo world', on_stdout=lambda data: print(data), on_stderr=lambda data: print(data))
print(result)
```
