Often people print bytes out and it looks ugly in Python 3.
Convert something like this to handle raw writing in Python 3 and with a file= argument for multiple streams. Can fallback to regular print in Python 2.
def print_raw(bytes):
"""Print bytes, preserving binary chars for color/CURSES/etc on command line."""
sys.stdout.buffer.write(bytes)
Often people print bytes out and it looks ugly in Python 3.
Convert something like this to handle raw writing in Python 3 and with a file= argument for multiple streams. Can fallback to regular print in Python 2.