Suppress/ print without b' prefix for bytes in Python 3

Solution 1:

Use decode:

print(curses.version.decode())
# 2.2

Solution 2:

If the bytes use an appropriate character encoding already; you could print them directly:

sys.stdout.buffer.write(data)

or

nwritten = os.write(sys.stdout.fileno(), data)  # NOTE: it may write less than len(data) bytes