How can I resolve TypeError with StringIO in Python 2.7?

前端 未结 2 836
花落未央
花落未央 2020-12-06 04:39

Trying to read following string as file using StringIO but getting the error below. How can I resolve it?

>> from io import StringIO
>&         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 04:49

    Rather use (fixes this exact issue for me):

    from StringIO import StringIO
    

提交回复
热议问题