You've already forked amazing-qr
mirror of
https://github.com/x-hw/amazing-qr.git
synced 2025-07-11 01:10:17 +02:00
17 lines
335 B
Python
17 lines
335 B
Python
![]() |
# -*- coding: utf-8 -*-
|
||
|
|
||
|
import draw, ecc, data
|
||
|
|
||
|
# ecl: Error Correction Level(L,M,Q,H)
|
||
|
def get_qrcode(ecl, str):
|
||
|
try:
|
||
|
ver, code = data.encode(ecl, str)
|
||
|
except UnicodeEncodeError:
|
||
|
print('Error input!!')
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
# test:
|
||
|
str = 'hello, world'
|
||
|
str2 = '💩'
|
||
|
get_qrcode(str2,1,2)
|