Skip to content

Instantly share code, notes, and snippets.

@filevich
Last active September 21, 2022 00:21
Show Gist options
  • Save filevich/efe4d3a21d00666c37c6e8de2cac71fe to your computer and use it in GitHub Desktop.
Save filevich/efe4d3a21d00666c37c6e8de2cac71fe to your computer and use it in GitHub Desktop.
simple progress print python
def progress(it,every,total):
r = (it+1) % delta == 0
p = ((it+1) / total) * 100
if r: print(f"{p:.0f}%");
for i in range(1_000_000):
progress(
it=i,
every=len(data)/10,
total=len(data))
"""
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment