-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write() not printing #342
Comments
can't reproduce this: C:\> tqdm --version
4.11.2
C:\> python
Python 2.7.13 |Anaconda 4.2.0 (64-bit)| (default, Dec 19 2016, 13:29:36) [MSC v.
1500 64 bit (AMD64)] on win32 >>> from time import sleep
>>> from tqdm import tqdm, trange
>>> for i in trange(10):
... sleep(1)
... tqdm.write(str(i))
...
0
1
2
3
4
5
6
7
8
9
100%|##########################################| 10/10 [00:10<00:00, 1.00s/it]
>>> What OS and terminal are you using? |
Thanks for the reply!
More specifically, I use version 2.7.1 of Terminal app, OS is macOS Sierra ver 10.12.2. You need to fail inside a loop at least once in order to reproduce the behavior. That occurs when you keep using tqdm with second loop after you got some error from first loop, like I did above. |
ah. ok. so the problem is you write invalid code (writing a non-string). I don't think tqdm (or any other library) should silently work properly in such a case. we could cast all input of tqdm.write to a string but that way lies dragons. |
I see. Ya, as you say automatically converting the type of input is obviously a bad idea. Instead, I think the module should be re-initialized when it encounters an exception. I never had such issue when using other modules that's why I reported this issue. I think it is still beneficial to users, but I understand the policy you have. |
@ntomita let's close the issue. I think your question / problem has been resolved. |
this might now be the case but I haven't checked. I recall fixing exceptions within iterations but not sure about when calling |
While I was investigating a problem in my program where it doesn't show a progress bar, I found another problem so I report it.
I will show up when I use tqdm in REPL, try running following code.
Sure, it fails since I'm passing an integer. I fix it and run it again,
Now it shows just a progress bar, no numbers printed at all.
Empirically speaking It will come back after I do tqdm().clear() and run some extra loops, like in this way...
So, I'm assuming something wrong with buffer handling. Have you ever observed this issue?
I'm using Python3 on mac with newest OS. tqdm have installed via pip3. I use standard terminal for REPL.
The text was updated successfully, but these errors were encountered: