hello wordl for DOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
434 B

#!/usr/bin/env python
import sys
srcpath = sys.argv[1]
name = sys.argv[2]
targetpath = sys.argv[3]
with open(srcpath, 'r') as f:
lines = [line.rstrip() for line in f]
with open(targetpath, 'w') as f:
for line in lines:
encoded = line.encode('cp437')
if len(encoded) > 0:
f.write(f'\tdb {", ".join(str(char) for char in encoded)}, 13, 10\n')
f.write('\tdb 13, 10\n')
f.write("\tdb '$'\n")