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 →


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")When to use
Section titled “When to use”- 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")Variants
Section titled “Variants”Options
Section titled “Options”

cell_size=3Code
pz.qr_code("https://albakore.github.io/pyzed/", cell_size=3)

cell_size=5Code
pz.qr_code("pyzed", cell_size=5)

color=, bg=Code
pz.qr_code("pyzed", cell_size=5, color="#74ade8", bg="#1e2228")Events
Section titled “Events”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.
Properties and API
Section titled “Properties and API”pz.qr_code
Section titled “pz.qr_code”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"). |