I am generating qrcodes by python, so I want to print directly to the label printer zebra, I can already print words contained in an entry, but when I try to print the qrcode of the error: code:
def printQrCode(self):
img = os.path.join(self.defaultLocation, self.qrPhotoTxt.get() + ".jpg")
image1 = Image.open(img)
basewidth = 240
wpercent = (basewidth / float(image1.size[0]))
hsize = int((float(image1.size[1]) * float(wpercent)))
image = image1.resize((basewidth, hsize), PIL.Image.ANTIALIAS)
self.photo = ImageTk.PhotoImage(image=image)
self.imgPanel.create_image(2, 2, anchor=NW, image=self.photo)
self.imgPanel.image = self.photo
label = """
^XA
^FO10,15
^A0,40,20
^FD
"""+image+"""
^FS
^FO10,60
^A0,40,20
^FD
Test Zebra
^FS
^FO10,105
^A0,40,20
^FD
Test Zebra
^FS
^XZ
"""
from zebra import zebra
z = zebra('ZDesigner ZT230-200dpi ZPL')
z.output(label)
error in question:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1532, in __call__
return self.func(*args)
File "E:/CharIp ServerFTP_1.1/CharIP_1.1.6/QRcodeTKinter.py", line 103, in printQrCode
"""+image+"""
TypeError: cannot concatenate 'str' and 'instance' objects
Could someone help me?