带有IOError的python打印:[Errno 0]错误

问题描述 投票:3回答:1
ll=[]
for ii in range(26):
    ll.append(chr(97+ii))

for ii in range(10000):
    print ll

当我这样打印时,会报告一些错误,为什么?!

['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r'Traceback (most recent call last):
  File "e:/czh/python/test.py", line 7, in <module>
    print ll
IOError: [Errno 0] Error
python-2.7 printing ioerror
1个回答
1
投票

这是Windows 10版本1803修复的Windows错误。(请参阅https://bugs.python.org/issue32245https://github.com/Microsoft/vscode/issues/36630#issuecomment-385759625

当使用调用WriteFile的代码路径(即os.write和传统标准I / O模式)时,它会影响Python 3.6+,并且还会影响Python 2.7和Python 3.5。

© www.soinside.com 2019 - 2024. All rights reserved.