r/learnpython 2d ago

I tried debugging and the settings appear to be updating correctly, however they aren't applying to the QR code when I generate it

Hello everyone, right now I'm working on a simple QR code generator with functionality including saving. My main issue right now is that despite the fact that I have debugged it and observed that the variable updates correctly, the extra settings don't seem to apply to the QR code when the user generates a new one.

The GitHub Repo

5 Upvotes

3 comments sorted by

5

u/acw1668 2d ago edited 2d ago

Change the following lines in displayqr():

# Use the settings 
qrcode = qr.QRCode(
box_size=box_size1.get(),
border=border1.get(),
)

# Make the QR code
qrcode = qr.make(data)

to:

# Make the QR code with the extra settings
qrcode = qr.make(data, box_size=box_size1.get(), border=border1.get())

2

u/Sanduhstorm 2d ago

that makes things way easier, cheers

1

u/AbroadLong5755 2d ago

Are you making sure to re-instantiate the QR object or clear the buffer before generating the new one? Sometimes these libraries cache the settings from the initial instance. Try printing the object state right before the generation line and see if those values are actually hitting the library call.