test cases/common/242 custom target feed/my_compiler.py
raw| 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | import sys |
| 4 | |
| 5 | if __name__ == '__main__': |
| 6 | if len(sys.argv) != 2: |
| 7 | print(sys.argv[0], 'output_file') |
| 8 | sys.exit(1) |
| 9 | ifile = sys.stdin.read() |
| 10 | if ifile != 'This is a text only input file.\n': |
| 11 | print('Malformed input') |
| 12 | sys.exit(1) |
| 13 | with open(sys.argv[1], 'w+') as f: |
| 14 | f.write('This is a binary output file.') |