Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- Exception in Tkinter callback
- Traceback (most recent call last):
- File "C:Python27liblib-tkTkinter.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
- label = """
- ^XA
- ^FO10,15
- ^A0,40,20
- ^FD
- ^FS
- ^FO10,60
- ^A0,40,20
- ^FD
- Test Zebra
- ^FS
- ^FO10,105
- ^A0,40,20
- ^FD
- Test Zebra
- ^FS
- ^XZ
- """
Add Comment
Please, Sign In to add comment