Jupyter Notebooks don't support Halo
See original GitHub issueWhile Halo works perfectly fine in the terminal, I can’t get Halo to work inside a Jupyter notebook. I am running the following code in the first cell of the notebook:
from halo import Halo
from time import sleep
with Halo(text='Loading', spinner='dots'):
sleep(5)
The program runs through without any errors, but no spinner is shown at all.
I figured out, that if you write something to stdout
with sys.stdout
prior to calling Halo
, then the spinner is shown, but each spinner and corresponding text are shown next to each other, i.e. clearing the current line doesn’t work.
from halo import Halo
import sys
from time import sleep
sys.stdout.write('test\n')
with Halo(text='Loading', spinner='dots'):
sleep(5)
returns the output
test
⠋ Loading⠙ Loading⠹ Loading⠸ Loading⠼ Loading⠴ Loading⠦ Loading⠧ Loading⠇ Loading⠏
Loading⠋ Loading⠙ Loading⠹ Loading⠸ Loading⠼ Loading⠴ Loading⠦ Loading⠧ Loading⠇
Loading⠏ Loading⠋ Loading⠙ Loading⠹ Loading⠸ Loading⠼ Loading⠴ Loading⠦ Loading⠧
Loading⠇ Loading⠏ Loading⠋ Loading⠙ Loading⠹ Loading⠸ Loading⠼ Loading⠴ Loading⠦
Loading⠧ Loading⠇ Loading⠏ Loading⠋ Loading⠙ Loading⠹ Loading⠸ Loading⠼ Loading⠴
Loading⠦ Loading⠧ Loading⠇ Loading⠏ Loading⠋ Loading⠙ Loading⠹ Loading⠸ Loading⠼
Loading⠴ Loading⠦ Loading⠧ Loading
Is there something wrong on my end, and do you have an idea how to fix that? It would be really nice if Halo worked with Jupyter too. Thanks for your efforts and for sharing this library!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Notebooks suck: change my mind : r/Python - Reddit
Many people blame Jupyter for encouraging bad coding habits, but I have another view: there is a lot of hard-to-read code in notebooks...
Read more >Halo CME on Twitter: "I enjoyed and learned at least something from ...
I still have difficulty of getting started, not even understanding basic things like how to open jupyter notebook, etc. More help needed for...
Read more >Supplement of EUREC A's HALO - ESSD
This notebook shows how to plot the flight tracks of the HALO aircraft. ... We generally don't support ignoring warnings, however, ...
Read more >Starter Programing Exercise | Monica Valluri
This programing exercises is designed to help you to become familiar with how to make some basic plots and carry out some simple...
Read more >fastpages | An easy to use blogging platform with support for ...
An easy to use blogging platform with support for Jupyter Notebooks. ... blog posts via GitHub Actions, so you don't have to fuss...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is fixed in #40 thanks to @JungWinter! This will be made available soon in next release. I need to do few fixes before making a release.
@JungWinter Please send a PR for this. I’ll review the code. 😄 Thank you for working on this!