Neels Hofmeyr | 3531a19 | 2017-03-28 14:30:28 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
2 | |||||
3 | import sys | ||||
4 | import atexit | ||||
5 | import time | ||||
6 | |||||
7 | |||||
8 | sys.stdout.write('foo stdout\n') | ||||
9 | sys.stderr.write('foo stderr\n') | ||||
10 | |||||
11 | print(repr(sys.argv)) | ||||
12 | sys.stdout.flush() | ||||
13 | sys.stderr.flush() | ||||
14 | |||||
15 | def x(): | ||||
16 | sys.stdout.write('Exiting (stdout)\n') | ||||
17 | sys.stdout.flush() | ||||
18 | sys.stderr.write('Exiting (stderr)\n') | ||||
19 | sys.stderr.flush() | ||||
20 | atexit.register(x) | ||||
21 | |||||
22 | while True: | ||||
23 | time.sleep(1) | ||||
24 | |||||
25 | # vim: expandtab tabstop=4 shiftwidth=4 |