How to Make QR Code Generator Using Python

Introduction :

Hello friends! So in today’s post, I am going to tell you how you can create QR Code of anything with the help of Python Programming Language, that is, if we say in simple language, today I am going to tell you how you How can you make your own “QR Code Generator” in this way? So if you also want to know about it, then read this post till the end and read it carefully so that you understand everything properly.

Library Installation :

Friends, to do this project, first of all we will need a library named qr-code. So first of all we have to install this library in our System (Computer) you can use pip command to install it as you can see below :-

pip install qrcode

Code for QR Code Generator :

import qrcode

img=qrcode.make("https://codewithshani.com/")

img.save("codewithshani.jpg")

Explanation :

1. In the first step, we have imported the ‘qrcode Library’ into our program.

2. After that, we created a variable named ‘img,’ and inside it, we wrote ‘qrcode.make.’ With the help of this function, we can create a QR code for anything. Then, we need to write the data for which we want to create a QR code. You can input any data here, whether it’s text or a URL. Right now, I’m going to create a QR code for my YouTube channel, so I’ve entered the URL of my YouTube channel there.

3. And after that we have to save this QR Code in an image, so to save it we have written “img.save” and inside this we have given the name of this image with which name we want to save this image, I have named this image “CodeWithShani.jpg” and friends, it is very important for you to apply the extension (.jpg) of this image. |

4. After that, as soon as you run this program, you will get an image of a QR Code.

Output :

codewithshani.com

Summary :

So in this way you can create QR Code of anything with the help of Python Programming Language and now I hope you would have liked this project very much and if you like it then please tell us by commenting and if you like this If you want to know about more such projects, then you must follow us and subscribe to our Youtube channel “CodeWithShani”.

Leave a Reply

Your email address will not be published. Required fields are marked *