def wrapwrite(text):
    text = text.encode('utf-8')
    try:
        sys.stdout.buffer.write(text)
    except AttributeError:
        sys.stdout.write(text)
def wrapwrite(text):
    text = text.encode('utf-8')
    try:
        sys.stdout.buffer.write(text)
    except AttributeError:
        sys.stdout.write(text)