VolksForth/tools/trunc-ctrl-z.py
Philip Zembrod 20a2715203 First properly evaluated CPM test: log-test, with golden file,
evaluate script and script to cut off CPM text files at ctrl-z (EOF)
2023-07-02 00:11:52 +02:00

16 lines
310 B
Python
Executable File

#!/usr/bin/python3
import sys
inFileName, outFileName = sys.argv[1], sys.argv[2]
inFile = open(inFileName, "rb")
source = inFile.read()
destination = bytearray()
for b in source:
if b == 26:
break
destination.append(b)
# result.append('')
outFile = open(outFileName, "wb")
outFile.write(destination)