Created
June 9, 2016 06:32
-
-
Save theeluwin/67f2af9130bddf4c39dabca47bbc3101 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/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