Skip to content

Commit e3a1344

Browse files
Update qrcode.py
1 parent 817ebb8 commit e3a1344

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

qrcode.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
# importing Required Modules
1+
22
import qrcode
3+
import cv2
4+
5+
qr= qrcode.QRCode(version=1, box_size=10, border=5)
36

4-
# QR Code Generator
5-
query = input("Enter Content: ") # Enter Content
6-
code = qrcode.make(query) # Making the QR code
7-
code.save("qrcode.png") # Saving the QR code file
7+
data = input()
8+
qr.add_data(data)
9+
qr.make(fit=True)
10+
img = qr.make_image(fill_color="blue", back_color="white")
11+
path=data+".png"
12+
img.save(path)
13+
cv2.imshow("QRCode",img)
14+
cv2.waitKey(0)
15+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)