Last active
May 17, 2023 15:00
-
-
Save ssoto/c549d57be7a37eae88dbcf033c8bba84 to your computer and use it in GitHub Desktop.
Mentoriando vol. III
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 | |
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