Guest User

Untitled

a guest
Feb 15th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. def printQrCode(self):
  2. img = os.path.join(self.defaultLocation, self.qrPhotoTxt.get() + ".jpg")
  3. image1 = Image.open(img)
  4. basewidth = 240
  5. wpercent = (basewidth / float(image1.size[0]))
  6. hsize = int((float(image1.size[1]) * float(wpercent)))
  7. image = image1.resize((basewidth, hsize), PIL.Image.ANTIALIAS)
  8. self.photo = ImageTk.PhotoImage(image=image)
  9. self.imgPanel.create_image(2, 2, anchor=NW, image=self.photo)
  10. self.imgPanel.image = self.photo
  11. label = """
  12. ^XA
  13.  
  14. ^FO10,15
  15. ^A0,40,20
  16. ^FD
  17. """+image+"""
  18. ^FS
  19.  
  20. ^FO10,60
  21. ^A0,40,20
  22. ^FD
  23. Test Zebra
  24. ^FS
  25.  
  26. ^FO10,105
  27. ^A0,40,20
  28. ^FD
  29. Test Zebra
  30. ^FS
  31.  
  32.  
  33. ^XZ
  34. """
  35.  
  36. from zebra import zebra
  37. z = zebra('ZDesigner ZT230-200dpi ZPL')
  38. z.output(label)
  39.  
  40. Exception in Tkinter callback
  41. Traceback (most recent call last):
  42. File "C:Python27liblib-tkTkinter.py", line 1532, in __call__
  43. return self.func(*args)
  44. File "E:/CharIp ServerFTP_1.1/CharIP_1.1.6/QRcodeTKinter.py", line 103, in printQrCode
  45. """+image+"""
  46. TypeError: cannot concatenate 'str' and 'instance' objects
  47.  
  48. label = """
  49. ^XA
  50.  
  51. ^FO10,15
  52. ^A0,40,20
  53. ^FD
  54.  
  55. ^FS
  56.  
  57. ^FO10,60
  58. ^A0,40,20
  59. ^FD
  60. Test Zebra
  61. ^FS
  62.  
  63. ^FO10,105
  64. ^A0,40,20
  65. ^FD
  66. Test Zebra
  67. ^FS
  68.  
  69.  
  70. ^XZ
  71. """
Add Comment
Please, Sign In to add comment