In Python 2.x könnte ich das tun:
import sys, array
a = array.array('B', range(100))
a.tofile(sys.stdout)
Jetzt bekomme ich jedoch eine TypeError: can't write bytes to text stream. Gibt es eine geheime Codierung, die ich verwenden sollte?
os.writewird sowohl auf Py2 als auch auf Py3 funktionieren.