Simple method to generate QR codes using Python

Deepak Radhakrishnan


Wanna generate QR codes quickly for your business? Try reading this blog. Here is a simple way using a few python codes.


QR codes or Quick Response code is an amazing technology that you can run into so casually in your daily life. Nowadays it is seen almost everywhere from shopping centres to magazines. It can be used in making easy payments, for sending messages and wishes or even to retrieve information. How about creating one for yourself? Here is a quick way to generate one using simple python codes.

Libraries Required

We need QR code library as well as PIL library . To install them run the below commands.

  • pip3 install qrcode
  • pip3 install image

Let’s Code

import qrcode

data = ""

outfile = "website.png"

img = qrcode.make(data)



We have generated QR code with 5 lines of code. You can even simplify this to 3 lines of code. Also you can embed this functionality to web frameworks like Django or Flask .

Hope you found what you have been looking for. This blog is about something which is becoming more and more common in the digital world.

How useful was this post?

Click on a starts to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow me on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

%d bloggers like this: