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
code more
This commit is contained in:
@ -7,17 +7,22 @@ def get_qrcode(ecl, str):
|
||||
try:
|
||||
# Data Coding
|
||||
ver, data_codewords = data.encode(ecl, str)
|
||||
ndc = 0
|
||||
for i in range(len(data_codewords)):
|
||||
ndc += len(data_codewords[i])
|
||||
|
||||
# Error Correction Coding
|
||||
ecc = ECC.encode(ver, ecl, data_codewords)
|
||||
ndc = 0
|
||||
for i in range(len(data_codewords)):
|
||||
ndc += len(data_codewords[i])
|
||||
|
||||
# Structure final bits
|
||||
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)
|
||||
|
||||
|
Reference in New Issue
Block a user