# Print to terminal instead of to Jupyter Notebook

**URL:** <https://discourse.julialang.org/t/print-to-terminal-instead-of-to-jupyter-notebook/70391>\
**Category:** General Usage\
**Created:** [October 26, 2021, 9:25am UTC](https://discourse.julialang.org/t/print-to-terminal-instead-of-to-jupyter-notebook/70391 "2021-10-26T09:25:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ismedina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ismedina/32/26433_2.png) [@ismedina](https://discourse.julialang.org/u/ismedina)\
**Post date:** [October 26, 2021, 9:25am UTC](https://discourse.julialang.org/t/print-to-terminal-instead-of-to-jupyter-notebook/70391/1 "2021-10-26T09:25:16Z")

</div>

I have a function that does some calculation and prints the ongoing progress, say

```julia
function f()
    for i in 1:10
        sleep(0.1)
        println(i) 
    end    
end

```

When running it in a Jupyter Notebook, the output cell soon gets cluttered. So I would like to forward this output to the terminal from where I launched the Jupyter Notebook, in the same way that when you run `] add Package` in a Jupyter Notebook, you get the progress information on the terminal.

Thanks a lot!

PS: `ProgressMeter` is amazing and the output very concise but it wouldn’t suit my needs, I need more detailed information of what’s going on inside the computation.

---

<div class="post-metadata">

**Author:** ![Egwene\_al\_Vere](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Post date:** [October 26, 2021, 6:48pm UTC](https://discourse.julialang.org/t/print-to-terminal-instead-of-to-jupyter-notebook/70391/2 "2021-10-26T18:48:57Z")

</div>

You may try something like

```julia
println(IJulia.orig_stdout[], "testing...")

```

[ref](https://github.com/JuliaLang/IJulia.jl/blob/6f92c422e380a610ade654d1c56f87cede6dcafa/src/kernel.jl#L37)

---

<div class="post-metadata">

**Author:** ![mihalybaci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mihalybaci/32/13528_2.png) [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Post date:** [October 26, 2021, 6:58pm UTC](https://discourse.julialang.org/t/print-to-terminal-instead-of-to-jupyter-notebook/70391/3 "2021-10-26T18:58:43Z")

</div>

This might not be the solution you’re thinking of, but you could switch to using [Pluto notebooks](https://github.com/fonsp/Pluto.jl) where things like `println` print to the terminal by default. The package `PlutoUI` also provides a handy `with_terminal` function that allows you to print within the notebook when you want that as well.

---

<div class="post-metadata">

**Author:** ![ismedina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ismedina/32/26433_2.png) [@ismedina](https://discourse.julialang.org/u/ismedina)\
**Post date:** [October 28, 2021, 10:28am UTC](https://discourse.julialang.org/t/print-to-terminal-instead-of-to-jupyter-notebook/70391/4 "2021-10-28T10:28:51Z")

</div>

> [@Egwene\_al\_Vere](#):
>
> `println(IJulia.orig_stdout[], "testing...")`

Works like a charm. Thanks so much!

---

<div class="post-metadata">

**Author:** ![ismedina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ismedina/32/26433_2.png) [@ismedina](https://discourse.julialang.org/u/ismedina)\
**Post date:** [October 28, 2021, 10:33am UTC](https://discourse.julialang.org/t/print-to-terminal-instead-of-to-jupyter-notebook/70391/5 "2021-10-28T10:33:40Z")

</div>

Hi, thanks a lot for the suggestion. I love Pluto notebooks, my reason to use Jupyter was that, at least when I started developing this code, Pluto didn’t support `Revise.jl`, which is very important for me since I make changes to the source files often. But it seems that they might have gotten the support since? ([https://github.com/fonsp/Pluto.jl/issues/238](https://github.com/fonsp/Pluto.jl/issues/238))

I might have to give it a try! 🙂
