Generate QR Code using Python

Last updated on February 26th, 2024 at 07:54 pm

How to Generate QR Code using Python?

 

#pip install pyqrcode
#pip install pypng
# Import QRCode from pyqrcode
import pyqrcode
import png
from pyqrcode import QRCode


# String for which website you want to enerate the QR code
website_url = "https://cbsepython.in/"

# Generate QR code
url = pyqrcode.create(website_url)


# Create and save the png file naming "myqr_code.png"
url.png('myqr_code.png', scale = 10)

 

Output:

myqr code

 

Jitendra Singh
✔ Verified Educator

Jitendra Singh

Founder of CBSEPython.in

I help CBSE Class 9–12 students learn Python, Information Technology, Artificial Intelligence and Computer Science through easy notes, quizzes, MCQs and sample papers.

Read More About Me →