Skip to content

Instantly share code, notes, and snippets.

@yoachim
Created August 9, 2018 22:45
Show Gist options
  • Save yoachim/6727c5501a3962a1247a9f69d99da043 to your computer and use it in GitHub Desktop.
Save yoachim/6727c5501a3962a1247a9f69d99da043 to your computer and use it in GitHub Desktop.
Python print loop progress wihtout any extra dependencies
import sys
max_i = int(10)
for i in range(max_i):
progress = i/float(max_i)*100
text = "\rprogress = %.1f%%"%progress
sys.stdout.write(text)
sys.stdout.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment