Skip to content

Instantly share code, notes, and snippets.

@theeluwin
Created June 9, 2016 06:32
Show Gist options
  • Select an option

  • Save theeluwin/67f2af9130bddf4c39dabca47bbc3101 to your computer and use it in GitHub Desktop.

Select an option

Save theeluwin/67f2af9130bddf4c39dabca47bbc3101 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, division
import sys
import time
def main(duration=600):
print("take some rest")
for iterator in range(duration):
sys.stdout.write("\r%6.02f%%" % (iterator * 100 / duration))
sys.stdout.flush()
time.sleep(1)
print("\rnow get back to work")
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment