Skip to content

QR code

Draws a QR code that encodes data. cell_size sets the size of each module; color and bg change its colors.

pz.qr_code · Category: Content · Full reference →

QR codeQR code
  • To pass a link, a Wi-Fi password or a pairing code to a phone.
import pyzed as pz
pz.row([
pz.qr_code("https://albakore.github.io/pyzed/", cell_size=5),
pz.qr_code("pyzed", cell_size=5, color="#74ade8", bg="#282c33"),
], spacing=24, align="center")
QR code: cell_size=3QR code: cell_size=3
cell_size=3
Code
pz.qr_code("https://albakore.github.io/pyzed/", cell_size=3)
QR code: cell_size=5QR code: cell_size=5
cell_size=5
Code
pz.qr_code("pyzed", cell_size=5)
QR code: color=, bg=QR code: color=, bg=
color=, bg=
Code
pz.qr_code("pyzed", cell_size=5, color="#74ade8", bg="#1e2228")

QR code has no events of its own: it shows what you give it. Like every widget it also has the 18 common events (click, double_click, right_click, mouse_enter, drag, key_down, resize…), attached with .on(...): see Events and Events of every component.

qr_code(data, *, cell_size=4.0, color=None, bg=None)

A QR code that encodes data.

Property Default Description
data required The text or URL to encode.
cell_size 4.0 Size of each module in pixels.
color None Text or icon color.
bg None Background color ("#rrggbb[aa]", (r, g, b[, a]) or "transparent").

Full reference →