Hacker News new | ask | show | jobs
by stratos123 14 days ago
You could use `iter(lambda:1,0)` to get an infinite iterator, then itertools can be dropped.
1 comments

Nice!

  python3 -c 'import random, time; any(time.sleep(0.01) or print(random.choice("\u2571\u2572"), end="", flush=True) for x in iter(lambda: 0, 1))'