Skip to main content

Create your own QR code using python.

 How to crate your own QR code and embed any link in it !

First of all thanks guys if you are reading this blog, in this blog we will be discussing about how to create our own Quick Response (QR) code and to for this small project we will be using Python Programming language since my blog is all about python 😁. 

Ok so before we dive into this project lets first understand a little about this QR code this thing what is this ? how it become so use full in modern world etc. etc. etc.  


What is QR code ?

A QR code is first invented by an Japanese automotive company named Denso Wave. After since it become so popular. Its because this image or in which it will be generated it can store a huge amount of data only in machine readable form. Its similarity matches to the barcode because both of them have black and white lines randomly in them. Using QR code we can track products, we can make easy payments, also can book our ticket online in one word it's safe to share information using the bar QR code. Generally if you guys don't know how a QR code looks like don't worry, here is how it looks like, and i also embedded my blog link in it so if you will scan (using any scanner) it will automatically open up the blog in your browser. Try it if you want ! and if not don't worry we will discuss it ahead in our blog.


QR code that I generated using python.

So how to use python to generate a QR code !

To do this we will use the QR code library of the Python.

So install it using pip install qrcode.

After installing the library import it "import qrocode". 

so the whole code looks something like this, 

import qrcode

data="https://pythonworkssolution.blogspot.com/2022/09/scrap-pdfs-using-python.htm"

qr_data=qrcode.QRCode(
    version=4,
    error_correction=qrcode.constants.ERROR_CORRECT_L,
    box_size=10,
    border=1
    )

qr_data.add_data(data)
qr_data.make(fit=True)
qr_gen = qr_data.make_image(fill_color="black", back_color="white")
qr_gen.save("blog.png")

So this is the whole code that will generate our QR code, you can make changes to this code as you for that
just play with this code a little. There not much in this code to tell you. As you can see there is a variable
named data. There i have given my blog link, if you want you can give any link there, not only link if you will
your that will be also appear in the browser, for more fun lets say you created an API and deployed it in
any cloud system and you have your website, then you can give that link also here and run the code, see
magic also if you want to make it an API for you we site you can do it using this code, for making API's python
has several frameworks you can use any of them if you want.

Do share this blog with others, it can be helpful for their school or college projects and also kids could get
idea about what QR code is! So this is all in this blog see you guys in my next blog.








Comments

Popular posts from this blog

How to Remove Dandruff: A Complete Guide

Dandruff can be an embarrassing and frustrating condition, but the good news is that it’s manageable. In this guide, we’ll explore what dandruff is, its causes, and the most effective ways to eliminate it. Whether you prefer home remedies or over-the-counter solutions, there’s something here for everyone. What is Dandruff? Dandruff is a common scalp condition characterized by flaking and itching. It occurs when the scalp sheds dead skin cells excessively, often due to dryness, sensitivity, or fungal infections. While it’s not harmful, it can be a nuisance and impact self-confidence. Causes of Dandruff Understanding the root causes of dandruff can help you choose the right treatment. Here are some common reasons: - Dry Skin: A dry scalp often leads to flaking, especially during winter months. - Sensitivity to Hair Products: Certain shampoos, conditioners, or styling products can irritate the scalp. - Fungal Infections: Malassezia, a type of yeast, thrives on oily scalps and can trigger ...

The Environmental Toll of Data Centers: Energy Consumption, Water Usage, and Carbon Emissions

Why Data Centers Are Danger To Environment ?     Data centers are critical for modern society because they serve as the backbone for modern infrastructure, to power modern business and technologies. They play crucial role to power modern internet, to host websites, applications and process customer data, storing huge volumes of data and powering e-commerce platforms. But with these great things there are some disadvantages are also related to data centers which makes them a threat to environment. Data centers helps in support cloud services, analytics, Storage, cloud computing, empowering streaming services like Amazon, Netflix, Facebook, You Tube, also AI and Machine learning rely on these data centers to process huge data to process business logics etc. But in order to do all these great tasks they need tremendous amount of energy and electricity to power networking, servers, storage equipment, cloud services and the infrastructure supporting these services. Data centers ae...

Revolutionizing Data Centers: Cutting-Edge Construction Techniques Reshaping the Digital Landscape

  In a world where a single data center can consume as much water in a day as a small city does in a year, the race to build more efficient digital fortresses is on. The humble data center, once a nondescript building humming with servers, has become a hotbed of architectural and engineering innovation. As these facilities evolve to meet the insatiable appetite for data processing and storage, they're reshaping the very foundations of construction technology. Modular Design: The Future of Data Center Architecture Gone are the days of painstakingly slow, brick-by-mortar builds. Today's data centers are rising from the ground at breakneck speeds, thanks to modular design. This isn't just a trend; it's a revolution, with up to 70% of facilities now being pieced together like high-tech Lego sets in factories before ever touching their final destination. The benefits are as stackable as the modules themselves: Speed demons: These prefab marvels sprint to completion 60% faste...