0

Why are my QR codes are returning empty?

I'm just making a simple QR code generator using python and Tkinter, when I finally got the thing to start making images, I find the QR isn't linking back to anything. here is my script: ``` import qrcode from tkinter import * #Function def Generate(): qr = qrcode.QRCode(box_size=20, border=2) qr.add_data(link.get) #Pretty sure the problem is here qr.make(fit=True) img = qr.make_image() img.save("./qr.png") #Window window = Tk() window.title("QR Code Generator") window.geometry("480x60") #Icon icon = PhotoImage(file="icon.png") window.iconphoto(True, icon) #Link Entry link = Entry(window, width="50") link.pack() #Button Generate = Button(window, text="Generate", command=Generate) Generate.pack() window.mainloop() ```

18th Jul 2025, 11:46 PM
Andres Salgueiro
Andres Salgueiro - avatar
1 Réponse
+ 1
qr.add_data(link.get()) Try this
19th Jul 2025, 1:41 AM
Zero
Zero - avatar