Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Python/qrcode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import qrcode #this module is used to convert any text or link to a qrcode image

n = input("Enter the msg or link you want to make the qrcode of :\n") #taking input from the user

img = qrcode.make(n) #make keyword is used to create a qr code


img.save("QR_code_img.jpg") #this step is to save qrcode in jpg format
#you can save it in other formats too see more on

#you can use another module called cv2 (Opencv) to read qrcodes in python


import cv2

d = cv2.QRCodeDetector()

val,points,qr = d.detectAndDecode(cv2.imread("QR_code_img.jpg"))

print("The value hide inside qrcode is printed below using opencv: ")
print(val)

#just like thaty we decoded the value in the qrcode
#to know more about the attributes present before detectAndDecode function refer the documentation