# Jupyter notebook: show output “in real time” instead of once cell finishes running

**URL:** <https://discourse.julialang.org/t/jupyter-notebook-show-output-in-real-time-instead-of-once-cell-finishes-running/80052>\
**Category:** Jupyter-Notebook\
**Created:** [April 26, 2022, 12:20pm UTC](https://discourse.julialang.org/t/jupyter-notebook-show-output-in-real-time-instead-of-once-cell-finishes-running/80052 "2022-04-26T12:20:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jollywatt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jollywatt/32/202198_2.png) [@Jollywatt](https://discourse.julialang.org/u/Jollywatt)\
**Post date:** [April 26, 2022, 12:20pm UTC](https://discourse.julialang.org/t/jupyter-notebook-show-output-in-real-time-instead-of-once-cell-finishes-running/80052/1 "2022-04-26T12:20:15Z")

</div>

At least on my system\*, the following Jupyter cell shows no output until execution finishes after 10s, when all the output appears at once.

```julia
## In:
for i in 1:10
    @show i
    sleep(1)
end

#= Out:
i = 1
i = 2
i = 3
i = 4
i = 5
i = 6
i = 7
i = 8
i = 9
i = 10

```

This is annoying for long computations where I want to print progress data or calculation results in real time, e.g.:

```julia
## In:
Flux.train!(loss, Flux.params(model), data, opt; Flux.throttle(() -> @show(loss(testbatch...)), 1))

#= Out:

loss(testbatch...) = 0.748777660585992
loss(testbatch...) = 0.7432442125793893
loss(testbatch...) = 0.7378878076566309
loss(testbatch...) = 0.7327608453399246
loss(testbatch...) = 0.727844955342706
loss(testbatch...) = 0.7230646648872169
loss(testbatch...) = 0.7185265377063492
loss(testbatch...) = 0.7141560986532893

```

How can I have real time output from notebook cells?

* * *

> **My system**
>
> macOS `10.15.7`
> 
> ```julia
> $ julia -v
> julia version 1.7.2
> 
> $ jupyter --version
> jupyter core : 4.7.0
> jupyter-notebook : 6.1.5
> qtconsole : not installed
> ipython : 7.19.0
> ipykernel : 5.4.2
> jupyter client : 6.1.7
> jupyter lab : 2.2.9
> nbconvert : 6.0.7
> ipywidgets : not installed
> nbformat : 5.0.8
> traitlets : 5.0.5
> 
> ```

---

<div class="post-metadata">

**Author:** ![JM\_Beckers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jm_beckers/32/22482_2.png) [@JM\_Beckers](https://discourse.julialang.org/u/JM_Beckers)\
**Post date:** [April 26, 2022, 12:26pm UTC](https://discourse.julialang.org/t/jupyter-notebook-show-output-in-real-time-instead-of-once-cell-finishes-running/80052/2 "2022-04-26T12:26:38Z")

</div>

> [@Jollywatt](#):
>
> ```julia
> for i in 1:10
> @show i
> sleep(1)
> end
> 
> ```

```julia
for i in 1:10
    @show i
    sleep(1)
    flush(stdout)
end

```
