add qr code

This commit is contained in:
Pritimay Sarkar
2023-09-26 15:16:40 +05:30
parent 76321eeb59
commit f745487527
3 changed files with 20 additions and 0 deletions

17
scripts/qrcode.py Normal file
View File

@@ -0,0 +1,17 @@
# Import QRCode from pyqrcode
import pyqrcode
import png
from pyqrcode import QRCode
import sys
# String which represents the QR code
s = sys.argv[1]
print(s)
# Generate QR code
url = pyqrcode.create(s)
# Create and save the svg file naming "myqr.svg"
url.svg("myqr.svg", scale = 8)
# Create and save the png file naming "myqr.png"
url.png('myqr.png', scale = 6)