Created
June 16, 2011 08:10
-
-
Save nailor/1028873 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 | |
| import sys | |
| import time | |
| from tornado.ioloop import IOLoop | |
| def printer(digit): | |
| def _do_print(): | |
| print digit | |
| ioloop.add_timeout(time.time() + digit, _do_print) | |
| ioloop = IOLoop.instance() | |
| digits = sys.argv[1:] | |
| for digit in digits: | |
| printer(int(digit)) | |
| else: | |
| ioloop.add_timeout(time.time() + int(digits[-1]), ioloop.stop) | |
| ioloop.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment