Posts

Showing posts with the label qr code

Generate QR Code in Python

Generate QR code in python using "qrcode" library import qrcode # pip install qrcode data = "youtube.com/@computergeek7442" img = qrcode.make(data) img.save("myqrcode.png") # For more control use this method def qrcode_generate(data): # create an object of QRCode class qr = qrcode.QRCode( version=1, # controls the size of the QR Code (1 to 40) the smallest is version 1 error_correction = qrcode.constants.ERROR_CORRECT_L, # controls the error correction # four constants available on the qrcode package: # ERROR_CORRECT_L About 7% or less errors can be corrected # ERROR_CORRECT_M (default) About 15% or less errors can be corrected # ERROR_CORRECT_Q About 25% or less errors can be corrected # ERROR_CORRECT_H About 30% or less errors can be corrected box_size=10, border=4 # controls how many boxes thick the border should be (the default is 4, which is the minimum according to the