Guild icon
PyScript 💻
💬 | General / tutorial
This channel is for questions and live chat during PyScript related tutorials taking place online or in-person at conferences.
Avatar
Hi there! Welcome. 👋
Avatar
Robust general 24/01/2025 01:25
Coding QR Code generator with Python
👍 1
Avatar
Nice one @Robust general - but can you make it work in PyScript..? 😉
Avatar
Robust general 24/01/2025 12:16
The question is does Pyscript support pyqrcode library?
Avatar
There's only one way to find out! 🙂
Avatar
Chris Laffra 29/03/2025 20:41
It does not look like you generated that project with an AI. Could you? 🤓
Avatar
Andrea Giammarchi 03/04/2025 10:01
I took a slightly different approach: https://pyscript.com/@agiammarchi/qr-code-generator-copy/latest?files=main.py """ 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:
  • images are never blurry, those are vectors
  • no need to bother the save + File + URL.createObjectURL dance
(edited)
Avatar
Original message was deleted or could not be loaded.
Does spam like this actually work? I doubt you'll find any success here.
Exported 9 message(s)
Timezone: UTC+0