Writing an export script. "No module named StringIO"

Hiah! I am writing an export script to support a custom model format for my game engine. I would really like to use StringIO to create buffers before I write them to the file. However, when I import StringIO blender gives the error: “No module named StringIO”.

This is my first time using Python, so I have no idea how to overcome this.

There isn’t a StringIO module in python, the StringIO class is a part of the ‘io’ module. Try the following instead


from io import StringIO

https://docs.python.org/3/library/io.html

Ah fantastic. Works perfectly!

Thanks