1
0
mirror of https://github.com/x-hw/amazing-qr.git synced 2025-07-11 01:10:17 +02:00
Files
amazing-qr/myqrcode.py

17 lines
335 B
Python
Raw Normal View History

2016-08-27 16:29:56 +08:00
# -*- 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)