forked from lincolnloop/python-qrcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.py
More file actions
37 lines (31 loc) · 923 Bytes
/
sample.py
File metadata and controls
37 lines (31 loc) · 923 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
import sys
from qrcode.main import *
outFile = 'smaple'
qr = QRCode(
border=2,
true_color=(82, 43, 188),
image_factory='pil',
extended_colors = {
"padding":(125, 112, 14),
"ec":(178, 44, 3),
"timing":(0, 66, 150),
"prob":(52, 20, 188),
"type":(0, 51, 150)},
image_factory_modifiers = {
"character":" ",
"shape":"circle" })
qr.add_data("https://github.com/assafnativ/python-qrcode.git\n", (143, 0, 4))
qr.add_data("https://github.com/lincolnloop/python-qrcode/pull/119", (48, 107, 23))
qr.make()
img = qr.make_image()
img.save(outFile + '.png')
qr.set_image_factory('svg')
img = qr.make_image()
img.save(outFile + '.svg')
qr.set_image_factory('tty')
img = qr.make_image()
img.save(sys.stdout)
qr.set_image_factory('ascii')
img = qr.make_image()
sys.stdout.write('\n' * 3)
img.save(sys.stdout)