A new line gets printed instead of updating the current line / Weird characters get printed
See original GitHub issueHi, Great library you’ve got. I started using it because I love the cool features
I just started working with alive-progress and tested it using the following script:
import time
items = range(10) # retrieve your set of items
with alive_bar(len(items)) as bar: # declare your expected total
for item in items: # iterate as usual
# process each item
bar() # call after consuming one item
time.sleep(1)
The output I get is :
python prints the progress bar to a new line instead of updating the current line Also notice how some characters are like ? (question marks) inside boxes (I’m guessing something wrong with character encoding ??)
I’m using Python 3.8.3 on Windows 10 build 19041.630 The console I’m using is the windows command prompt The font used in the console is Consolas If you want more info, I’m willing to provide. Thank You !!
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
python - Print to the same line and not a new line?
hehe. Python Script: Print new line each time to shell rather than update existing line. I have a program that is telling me...
Read more >Overwrite Previously Printed Lines | by Thijmen Dam
Print line, but end with a carriage return instead of a newline character. This moves the cursor back to the beginning of the...
Read more >Advancing to the Next Print Line | Start Using C++
With C++, text sent to the screen does not automatically advance to the next physical line. You have to print a newline character...
Read more >Python New Line: How to Print WITHOUT Newline in Python
To get the strings to print without a newline, in python2.x you will have to add a comma (,) at the end of...
Read more >Your Guide to the Python print() Function
This prints an uppercase letter A and a newline character, which correspond to decimal values of 65 and 10 in ASCII. However, they're...
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
Yeah, it may be a limitation of the terminal itself. Please try on the new windows terminal: https://www.howtogeek.com/673729/heres-why-the-new-windows-10-terminal-is-amazing/
Hey man, thank you! I wish you like it even more after it start working right for you!
Well, it seems there’s two problems in there. The new line I’ve found recently it does occur on Windows, only inside the basic python interpreter. Unfortunately, all function calls inside python on Windows prints its result on screen!! Argh 😞 That’s why the lines all start with “on N: N”, it’s the current line that python interpreter arbitrarily prints…
So please try it inside ipython, it’s a way better environment anyway (I use it 100% of the time):
The new version in the works (#51) will not return the current line, so it should fix that.
The other problem is the weird characters. Unfortunately I think the basic command prompt on Windows really does not support them. They are control chars that I use to improve presentation like clearing the line, hiding the cursor, etc. For this I recommend installing the new WSL - Windows Subsystem for Linux. I’ve installed it on my gaming machine with Windows 10 Home Edition, and it’s awesome! With it you get to use a very improved terminal app, with a much better shell like ZSH.