Skip to content

Image printing error in Python 3, use bytearray() #27

Description

@adamhrv

Thanks for building this. Printing in python2.7 works great.
But in python3 the image printing did not output an image.

It seems the chr() function incorrectly encodes integers to bytes in python3.

Replacing the write_bytes function with the following works in python3:

def write_bytes(self, byte_array):
        msg = bytearray(byte_array)
        self.write(msg)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions