Last active
September 21, 2022 00:21
-
-
Save filevich/efe4d3a21d00666c37c6e8de2cac71fe to your computer and use it in GitHub Desktop.
simple progress print python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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