16 lines
425 B
Python
Executable File
16 lines
425 B
Python
Executable File
#!/usr/bin/env python3
|
|
import qrcode
|
|
|
|
for fname in ["qrEvent_en", "qrEvent_vi"]:
|
|
qr = qrcode.QRCode(
|
|
version=2,
|
|
error_correction=qrcode.constants.ERROR_CORRECT_Q,
|
|
box_size=5,
|
|
border=1)
|
|
|
|
with open(f"{fname}.txt") as fp:
|
|
qr.add_data(fp.read())
|
|
qr.make(fit=True)
|
|
img = qr.make_image(fill_color="orangered", back_color="white")
|
|
img.save(f"{fname}.png")
|