diff --git a/escpos/printer.py b/escpos/printer.py index 31b00c0..de88814 100644 --- a/escpos/printer.py +++ b/escpos/printer.py @@ -159,7 +159,10 @@ class File(Escpos): def _raw(self, msg): """ Print any command sent in raw format """ - self.device.write(msg); + if type(msg) is str: + self.device.write(msg.encode()); + else: + self.device.write(msg); def __del__(self):