Skip to content
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

Not working in while statement #44

Open
xyus opened this issue Feb 8, 2020 · 1 comment
Open

Not working in while statement #44

xyus opened this issue Feb 8, 2020 · 1 comment

Comments

@xyus
Copy link

xyus commented Feb 8, 2020

import random
import pyprind
random.seed(1)
collection = set()
import time
n = 100
bar = pyprind.ProgBar(n, track_time=False, title='while example')
i=0
while i < n:
r = random.randint(0, 10**5)
if r % 7 and r not in collection:
collection.add(r)
bar.update()
i=i+10
time.sleep(0.04)
The code above does not work. Please give me some advice, thanks.
while example
0% [### ] 100%

@rasbt
Copy link
Owner

rasbt commented Feb 10, 2020

Hm, that's weird. Just tried your example and it worked. Did you maybe have a different indentation?
Screen Shot 2020-02-10 at 2 58 00 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants