Почему-то выдает ошибку. Помогите пожалуйста разобраться
Ошибка:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "C://pythonProject/qrgenerator.py", line 18, in QR_generator
qr = pyqrcode.create(value)
File "C:\\pythonProject\venv\lib\site-packages\pyqrcode\__init__.py", line 111, in create
return QRCode(content, error, version, mode, encoding)
File "C:\\pythonProject\venv\lib\site-packages\pyqrcode\__init__.py", line 137, in __init__
guessed_content_type, encoding = self._detect_content_type(content, encoding)
File "C:\\pythonProject\venv\lib\site-packages\pyqrcode\__init__.py", line 307, in _detect_content_type
c = content.encode('shiftjis')
AttributeError: 'StringVar' object has no attribute 'encode'
import pyqrcode
from tkinter import *
from PIL import ImageTk, Image
root = Tk()
root.title('QR Генератор')
root.geometry('300x200+700+400')
root["bg"] = "#c0c0c0"
value = StringVar()
ent = Entry(textvariable=value, font='17')
ent.pack()
ent.place(x=55,y=5)
def QR_generator():
qr = pyqrcode.create(value)
qr.png('qrcode.png')
butt = Button(root, text='Генерировать', font='35', bg='#ccc', width=19, command=QR_generator)
butt.pack()
butt.place(x=55, y=33)
root.mainloop()