Generate QR Code with Python

Let’s learn how we can Generate QR Code with Python, first of all let’s talk about QR Code, and after that we are going to use qrcode Python library for this.

 

 

What is QR Code ?

QR code (Quick Response code) is two dimensional barcode that can be scanned using  smartphone camera to quickly access information or website. QR codes are used for different purposes, such as storing contact information, URLs, product information and many more. QR codes can store much more information than traditional barcodes, QR codes are good, because they can be scanned using a smartphone or QR code reader. QR codes are often used in advertising, marketing and as a quick and easy way to access information.

 

 

 

How to Generate QR Code with Python ?

First of all we need to instal qrcode library, and you can use pip for the installation, open your command prompt or terminal and write this command.

 

 

This is basic example:

This code creates QR code that encodes the URL  https://codeloop.org and saves it in to a file at name of qrcode.png. you can customize QR code by adjusting the parameters of QRCodeobject, such as the version (size), error_correction level, box_size and border. make_image function allows you to set the fill color and background color of the QR code.

 

 

 

 

This will be the result

Generate QR Code with Python
Generate QR Code with Python

 

Subscribe and Get Free Video Courses & Articles in your Email

 

Leave a Comment

Share via
Copy link
Powered by Social Snap
×