string io library python 3 code example
Example: python import stringIO
try:
from StringIO import StringIO ## for Python 2
except ImportError:
from io import StringIO ## for Python 3
try:
from StringIO import StringIO ## for Python 2
except ImportError:
from io import StringIO ## for Python 3