Created
March 22, 2023 20:07
-
-
Save lubianat/8d11903fd0d40684df6219e167c2bbcf to your computer and use it in GitHub Desktop.
Create a QR Code using Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qrcode | |
# the link that you want to convert into a QR code | |
link = "https://lubianat.github.io/natal_bioinformatics2wikidata/" | |
# create a QR code instance | |
qr = qrcode.QRCode(version=1, box_size=10, border=5) | |
# add data to the QR code instance | |
qr.add_data(link) | |
# make the QR code instance fit the data | |
qr.make(fit=True) | |
# create an image from the QR code instance | |
img = qr.make_image(fill_color="black", back_color="white") | |
# save the image as a PNG file | |
img.save("qr_code.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment