Generate QR Code using Python

Generate QR Code using pyqrcode module in Python

 

Let's see how to generate QR code using python  

    The pyqrcode module is a QR code generator. pyqrcode module can automates most of the building process for creating QR codes. pyqrcode module only requires Python 2.6, Python 2.7, or Python 3.

Installation  

$ pip install pyqrcode

Install in order to save image in png format:

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

#Enter string which will store in QR Code
s=input("Enter Data !") #string input "https://tecworms.blogspot.com/"

QRG =pyqrcode.create(s)

#create input methods to give dynamic names for saving file
svgFilename=input("Enter SVG File Name : ")
pngFilename=input("Enter PNG File Name : ")

# Create and save the svg and png file naming 
QRG.svg(svgFilename+".svg",scale=10)
QRG.png(pngFilename+".png",scale=8)

print("QR Generated Succesfully !!")

Output


 


Please share your views and let me know how more innovative it can be. 






Comments

Popular posts from this blog

Quantum Computing: The Next Frontier in Computing

Unlocking the Future: 10 Key Insights into Web3 Technologies

Random thoughts !