'tqdm not displaying progress bar in Atom
Using the tqdm module in Python on a Mac using Atom. I am trying to use a progress bar with the tqdm module and am using this code:
from tqdm import tqdm
from time import sleep
for i in tqdm(range(10000)):
time.sleep(0.5)
and it only returns[Finished in 0.121s].
I don't know whether this is my fault or an Atom error but don't know how to fix it. When I run this code in IDLE it works fine, it is just Atom that doesn't run it.
Any solves?
EDIT: I changed the code to
from tqdm import tqdm
import time
from time import sleep
for i in tqdm(range(10000)):
time.sleep(0.5)
as it started throwing up the error
NameError: name 'time' is not defined
[Finished in 0.12s]
and now it just displays noting in the console output, not even the [Finished in 0.121s] that it did before.
Solution 1:[1]
Since you've already imported sleep from time, instead of
time.sleep(0.5)
try this instead
sleep(0.5)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | K___V |
