1
0
mirror of https://github.com/x-hw/amazing-qr.git synced 2025-07-15 01:24:37 +02:00

complete more

This commit is contained in:
sylnsfar
2016-08-28 23:07:55 +08:00
parent e836a50719
commit e6fe986e6d
4 changed files with 100 additions and 6 deletions

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import draw, ECC, data, structure
import data, ECC, structure, matrix, draw
# ecl: Error Correction Level(L,M,Q,H)
def get_qrcode(ecl, str):
@ -15,7 +15,11 @@ def get_qrcode(ecl, str):
final_bits = structure.structure_final_bits(ver, ecl, data_codewords, ecc)
# Get the QR Matrix
qrmatrix = matrix.get_qrmatrix(ver, ecl, final_bits)
for i in qrmatrix:
print(i)
# Draw the picture
draw.draw_qrcode(qrmatrix)
except UnicodeEncodeError:
print('Error input!!')
@ -24,5 +28,6 @@ def get_qrcode(ecl, str):
if __name__ == '__main__':
# test:
str = 'HELLO WORLD'
str2 = '💩'
get_qrcode('M',str)
str2 = 'http://www.thonky.com/qr-code-tutorial/log-antilog-table'
err = '💩'
get_qrcode('H',str2)