







""" QR Code Generator. """
import segno
from pyscript import document, when
@when('click', '#generate-qr-code-btn')
def on_generate_qr_code_btn_click():
# Generate a 5-H QR code from the content of the text input.
text_input = document.querySelector("#qr-code-input")
qrcode = segno.make(text_input.value, error='h')
# Show the QR code in the target div element.
out = document.querySelector("#qr-code-img")
out.innerHTML = qrcode.svg_inline(scale=5)
that's pretty much it:
