Python 3 pyqrcode Example Script to Generate QR Codes and Save it as PNG Image Using pypng Library Full Tutorial For Beginners

Python 3 pyqrcode Example Script to Generate QR Codes and Save it as PNG Image Using pypng Library Full Tutorial For Beginners

 

 

 

Welcome folks today in this post we will be generating qr codes and saving it to png image file using pyqrcode library in python. All the source code of the application will be given below.

 

 

 

Get Started

 

 

 

In order to get started you need to install the following libraries using pip command inside your python project

 

pip install pyqrcode

 

pip install pypng

 

After installing all these libraries now make an app.py file and copy paste the following code

 

app.py

 

 

import pyqrcode
address = "https://pythonprogramming.altervista.org/"
url = pyqrcode.create(address)
url.png('uca-url.png', scale=8)
print(url.terminal(quiet_zone=1))

 

 

So now if you execute this python script by typing the below command

 

python app.py

 

 

You will see a qr code generated and save it as png file inside your root directory as shown below

READ  Join 12 Django Python Whatsapp Group Link For Django Developers in 2021 | Python Django Whatsapp Group Links For Python Developers | Whatsapp Group Links For Django Python Programmers

 

 

 

Leave a Reply