In python 2.x I could do this:
import sys, array a = array.array(\'B\', range(100)) a.tofile(sys.stdout)
Now however, I get a TypeErro
TypeErro
import os os.write(1, a.tostring())
or, os.write(sys.stdout.fileno(), …) if that's more readable than 1 for you.
os.write(sys.stdout.fileno(), …)
1