| Bram Moolenaar | c4da113 | 2017-07-15 19:39:43 +0200 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | # | ||||
| 3 | # Program that writes a number to stdout repeatedly | ||||
| 4 | # | ||||
| 5 | # This requires Python 2.6 or later. | ||||
| 6 | |||||
| 7 | from __future__ import print_function | ||||
| 8 | import sys | ||||
| 9 | import time | ||||
| 10 | |||||
| 11 | if __name__ == "__main__": | ||||
| 12 | |||||
| 13 | done = 0 | ||||
| 14 | while done < 10: | ||||
| 15 | done = done + 1 | ||||
| 16 | print(done) | ||||
| 17 | sys.stdout.flush() | ||||
| 18 | time.sleep(0.05) # sleep 50 msec | ||||