You've already forked amazing-qr
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:
13
myqrcode.py
13
myqrcode.py
@ -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)
|
Reference in New Issue
Block a user