#!/usr/bin/python import sys infile = sys.argv[1] outfile = sys.argv[2] fin = open(infile,"r") filecontents = fin.read() strlist = filecontents.split() fin.close() intlist = map(int, strlist) bytes = bytearray(intlist) fout = open(outfile, "wb") fout.write(bytes) fout.close()