在python 2.x中,我可以这样做:
import sys, array a = array.array('B', range(100)) a.tofile(sys.stdout)
然而,现在,我得到了一个TypeError: can't write bytes to text stream.我应该使用一些秘密编码吗?
TypeError: can't write bytes to text stream
python python-3.x
python ×1
python-3.x ×1