I am not a pro and I have been scratching my head over understanding what exactly StringIO is used for. I have been looking around the internet for some examples. However, almos
I've just used StringIO in practice for two things:
print
ing, by redirecting sys.stdout
to a StringIO
instance for easy analysis;ElementTree
and then write
it for sending via a HTTP connection.Not that you need StringIO
often, but sometimes it's pretty useful.