django StringIO出错
2019-08-01 本文已影响0人
TTTRX
python version=3.6
提出问题
from io import StringIO
sio = StringIO.StringIO()
错误提示:
AttributeError: type object '_io.StringIO' has no attribute 'StringIO'
解决办法
from io import StringIO
sio = StringIO()
参考链接
AttributeError: type object '_io.StringIO' has no attribute 'StringIO'
