-
Notifications
You must be signed in to change notification settings - Fork 726
Expand file tree
/
Copy path__init__.py
More file actions
39 lines (31 loc) · 762 Bytes
/
__init__.py
File metadata and controls
39 lines (31 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from qrcode import image
from qrcode.constants import (
ERROR_CORRECT_H,
ERROR_CORRECT_L,
ERROR_CORRECT_M,
ERROR_CORRECT_Q,
)
from qrcode.main import QRCode, make
__all__ = [
"ERROR_CORRECT_H",
"ERROR_CORRECT_L",
"ERROR_CORRECT_M",
"ERROR_CORRECT_Q",
"QRCode",
"image",
"make",
"run_example",
]
def run_example(data="http://www.lincolnloop.com", *args, **kwargs):
"""
Build an example QR Code and display it.
There's an even easier way than the code here though: just use the ``make``
shortcut.
"""
qr = QRCode(*args, **kwargs)
qr.add_data(data)
im = qr.make_image()
im.show()
if __name__ == "__main__": # pragma: no cover
import sys
run_example(*sys.argv[1:])