Change the code from item = create_string_buffer('000'*128) to item = create_string_buffer(b'000'*128) the b is for bytes
and also change
for line in to_display:
print ' '.join(line)
to below code
for line in to_display:
str_line = str(line)
print (' '.join(str_line))
since you are...