Skip to content

Instantly share code, notes, and snippets.

@sublee
Created December 4, 2015 17:55
Show Gist options
  • Save sublee/2c8807559fc7179d9d1c to your computer and use it in GitHub Desktop.
Save sublee/2c8807559fc7179d9d1c to your computer and use it in GitHub Desktop.
# Usage: python test_progress.py progress.bar.IncrementalBar
import importlib
import sys
import time
mod_name, __, cls_name = sys.argv[1].rpartition('.')
mod = importlib.import_module(mod_name)
cls = getattr(mod, cls_name)
try:
progress = cls(max=100)
for x in range(100):
time.sleep(0.1)
progress.next()
finally:
progress.finish()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment