-
-
Save wickedchicken/2962086 to your computer and use it in GitHub Desktop.
:o
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 | |
| """:o | |
| A detailed description of :o. | |
| """ | |
| import optparse | |
| import sys | |
| import time | |
| def main(opts, args): | |
| seq = [":o ", " ö ", " o:", " ö "] | |
| i = 0 | |
| while True: | |
| print "\r", " " * 20, seq[i], " " * 20, | |
| sys.stdout.flush() | |
| i = (i+1) % len(seq) | |
| time.sleep(opts.delay / (1000.0)) | |
| if __name__ == '__main__': | |
| prog_desc = ' :o ' | |
| usage = '%prog' | |
| parser = optparse.OptionParser(usage=(usage + '\n\n' + prog_desc)) | |
| parser.add_option('-d', '--delay', default=120, | |
| help='delay in ms between updates') | |
| (options, posargs) = parser.parse_args() | |
| sys.exit(main(options, posargs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment