Here is an example of a simple QR code generator in Python using the qrcode library:
import qrcode
data = "Hello"
qr = qrcode.QRCode(
version=1,
box_size=10,
border=5
)
qr.add_data(data)
qr.make(fit=True)
img = qr.make_image(fill_color="black", back_color="white")
img.save("qr.png")
In this example, the QR code will contain the data and will be saved as an image file "qr.png" in the current working directory. You can also change the version, box_size and border of QR code as per your requirement.
Comments
Post a Comment