import qrcode def generate_qrcode(weblink): qr = qrcode.QRCode(version=1, box_size=10, border=5) qr.add_data(weblink) qr.make(fit=True) qr_img = qr.make_image(fill="black", back_color="white") qr_img.save("qrcode.png") # Example usage generate_qrcode("https://www.google.com")