add qr code
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,3 +6,5 @@ env/
|
|||||||
*.json
|
*.json
|
||||||
cloud-functions/python/functions/__pycache__/
|
cloud-functions/python/functions/__pycache__/
|
||||||
*.pkl
|
*.pkl
|
||||||
|
*.png
|
||||||
|
*.svg
|
||||||
@@ -46,6 +46,7 @@ PyJWT==2.8.0
|
|||||||
pyparsing==3.1.1
|
pyparsing==3.1.1
|
||||||
pypdf==3.15.4
|
pypdf==3.15.4
|
||||||
pypng==0.20220715.0
|
pypng==0.20220715.0
|
||||||
|
PyQRCode==1.2.1
|
||||||
pyserial==3.5
|
pyserial==3.5
|
||||||
python-bidi==0.4.2
|
python-bidi==0.4.2
|
||||||
python-dateutil==2.8.2
|
python-dateutil==2.8.2
|
||||||
|
|||||||
17
scripts/qrcode.py
Normal file
17
scripts/qrcode.py
Normal 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)
|
||||||
Reference in New Issue
Block a user