Skip to content

Instantly share code, notes, and snippets.

@ssoto
Last active May 17, 2023 15:00
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 ssoto/c549d57be7a37eae88dbcf033c8bba84 to your computer and use it in GitHub Desktop.
Save ssoto/c549d57be7a37eae88dbcf033c8bba84 to your computer and use it in GitHub Desktop.
Mentoriando vol. III
import qrcode
import qrtools
import uuid
def create_qr_code(qr_content, qr_path):
qr = qrcode.QRCode(version=1, box_size=10, border=5)
qr.add_data(qr_content)
qr.make(fit=True)
imagen_qr = qr.make_image(fill_color="black", back_color="white")
imagen_qr.save(qr_path)
def read_qr_image(qr_path):
# TODO
return data
print('HOLA HOLA')
# Crea un UUID4
code = str(uuid.uuid4())
create_qr_code(code, './qr_image.png')
print(f"I've created a qr image with {code}")
qr_content = read_qr_image('./qr_image.png')
print(f"I've readed this code from qr_image {code}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment