How to generate QR code using Python

Modules Required
  1. pip install pyqrcode
  2. pip install pypng
pyqrcode
pyqrcode module is used to generate the QR code and it is written in pure python.
This module is compatible with Python 2.6 , 2.7 and 3.x.

pypng
pypng module is used to save the code in the PNG format.

code

import pyqrcode
import png
from pyqrcode import QRCode

#text which we want to put inside the QR code
text="https://hackingsnippet.blogspot.com/"

#to create the QR code
QR_code = pyqrcode.create(text)

#to save the QR code
QR_code.png('code.png', scale=6)

#to show the QR code generated
QR_code.show()

Output





Comments

Popular posts from this blog

How to make a folder completely hidden

Java

How to hack wifi password using cmd