Closed pranjal-joshi closed 3 years ago
Hello @pranjal-joshi,
Yeah, those square blocks are weird, but it's odd. I had a similar question recently, that on Windows it wasn't showing control characters, but Unicode was OK (in #83)... Which font are you using on your terminal? Are you sure it does contain Unicode chars?
Thanks for the quick help!
I went through #83.
Currently, I am using Monaco
font with my Command Prompt. However, I tried all of the font option available for cmd but everytime I am getting different kind of blocks but not the desired result.
Could you try it in the new windows terminal?
The square blocks typically mean it's not a good font. Try installing a nerd font.
Yes, that's a great suggestion! I use nerd fonts myself, have several installed like Hack, FiraCode, Source Code Pro, Dejavu, VictorMono, etc. These fonts should always have all exotic characters you'd ever need.
@rsalmei @TheTechRobo
I'm shipping my application binaries using pyinstaller
.
Is it possible to ship one of the Nerd Font with it and automatically set it console font?
I don't think so, unless you bundle a full-on terminal with it. :/
Font choice is set by the console, not the program, sadly.
Did Nerd fonts work? If so, you could always simply suggest it, saying that if it doesn't work try the nerd font...
In any case it's not horrible, they'll just see little squares instead of bits of the progress bar.
Sure! I will try more about packing font in the executable. I will reopen and update if I found a way to do it. meanwhile, I just use the following code to avoid bad-looking blocks:
import platform
bar = 'smooth'
spinner = 'waves'
if 'Windows' in platform.platform():
bar = 'classic2'
spinner = 'dots_recur'
with alive_bar(numStocks,bar=bar,spinner=spinner) as progressbar:
# Do some stuff here
progressbar()
Thank you both for quick support! 😃
Hello,
My code with
smooth
bar andwaves
spinner works well on Ubuntu.However, the same code on Windows 10 shows incorrect output due to the Unicode issue.
Please suggest a workaround for this!