Changeset 40 for trunk/bin/bletchley-decode
- Timestamp:
- 03/17/13 22:26:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/bletchley-decode
r28 r40 1 #!/usr/bin/env python 1 #!/usr/bin/env python3 2 2 3 # Requires Python 2.7+3 # Requires Python 3+ 4 4 5 5 ''' … … 45 45 sys.exit(0) 46 46 47 input_file = sys.stdin 47 input_file = sys.stdin.buffer 48 48 if options.input_file is not None: 49 input_file = file(options.input_file, 'rb')49 input_file = open(options.input_file, 'rb') 50 50 51 blob = input_file.read() 51 blob = input_file.read().rstrip(b'\r\n') 52 52 53 53 specified_encodings = options.encoding_chain.split(',') 54 sys.stdout. write(blobtools.decodeChain(specified_encodings, blob))54 sys.stdout.buffer.write(blobtools.decodeChain(specified_encodings, blob))
Note: See TracChangeset
for help on using the changeset viewer.