StringIO in Python3
when i write import StringIO it says there is no such module.
From What’s New In Python 3.0:
cStringIOmodules are gone. Instead, import the
iomodule and use
io.BytesIOfor text and datarespectively.
A possibly useful method of fixing some Python 2 code to also work in Python 3 (caveat emptor):
try: from StringIO import StringIO ## for Python 2except ImportError: from io import StringIO ## for Python 3
Note: This example may be tangential to the main issue of the question and is included only as something to consider when generically addressing the missing
StringIOmodule. For a more direct solution the message
TypeError: Can't convert 'bytes' object to str implicitly, see this answer.