Fix for string operation

* With Python version 3 data and text are treated different. Convert the
* text accordingly.
This commit is contained in:
Christoph Heuel 2015-05-19 02:52:55 +02:00
parent afc6834082
commit b99c076bae
1 changed files with 4 additions and 1 deletions

View File

@ -159,6 +159,9 @@ class File(Escpos):
def _raw(self, msg): def _raw(self, msg):
""" Print any command sent in raw format """ """ Print any command sent in raw format """
if type(msg) is str:
self.device.write(msg.encode());
else:
self.device.write(msg); self.device.write(msg);