1 | #!/usr/bin/env python |
2 | from __future__ import print_function |
3 | """ |
4 | stdout_stderr.py |
5 | |
6 | Tool for testing redirects. |
7 | """ |
8 | |
9 | import sys |
10 | |
11 | |
12 | def main(argv): |
13 | try: |
14 | stdout = argv[1] |
15 | stderr = argv[2] |
16 | except IndexError: |
17 | stdout = 'STDOUT' |
18 | stderr = 'STDERR' |
19 | print(stdout) |
20 | print(stderr, file=sys.stderr) |
21 | |
22 | if __name__ == '__main__': |
23 | main(sys.argv) |