Skip to content

Instantly share code, notes, and snippets.

@kirshiyin89
Created June 7, 2021 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirshiyin89/fa3719f41dfbbf96ec4b1d1307ef7cb8 to your computer and use it in GitHub Desktop.
Save kirshiyin89/fa3719f41dfbbf96ec4b1d1307ef7cb8 to your computer and use it in GitHub Desktop.
QR Code scanner
import qrcode
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=5,
border=4,
)
data = 'Peppermint. Uses: indigestion, nausea. Steep time: 5-10 mins.'
qr.add_data(data)
qr.make(fit=True)
img = qr.make_image(fill_color="black", back_color="white")
img.save('peppermint.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment