How to Create QR Code Generator in Python | Free Lifetime QR Code Generator | Python Project

Опубликовано: 06 Август 2026
на канале: The Millennial Guy
36
8

Full Code :
-----------------------------------------------------------------------------------------------------

import customtkinter as ctk
from PIL import Image, ImageTk
import pyqrcode
import os

Set theme
ctk.set_appearance_mode("dark") # "light" or "dark"
ctk.set_default_color_theme("blue")

Main window
app = ctk.CTk()
app.title("QR Code Generator")
app.geometry("500x600")

def generate_qr():
name = name_entry.get()
link = link_entry.get()

if name == "" or link == "":
status_label.configure(text="Please fill both fields!", text_color="red")
return

file_name = name + ".png"

Create QR
qr = pyqrcode.create(link)
qr.png(file_name, scale=8)

Load image
img = Image.open(file_name)
img = img.resize((250, 250))
qr_img = ImageTk.PhotoImage(img)

qr_label.configure(image=qr_img)
qr_label.image = qr_img

status_label.configure(text="QR Code Generated Successfully!", text_color="green")

Heading
title = ctk.CTkLabel(app, text="QR Code Generator", font=("Arial", 32, "bold"))
title.pack(pady=20)

Frame for inputs
frame = ctk.CTkFrame(app)
frame.pack(pady=10, padx=20, fill="x")

name_label = ctk.CTkLabel(frame, text="QR File Name:")
name_label.pack(anchor="w", pady=5)

name_entry = ctk.CTkEntry(frame, placeholder_text="Enter file name")
name_entry.pack(fill="x", padx=10)

link_label = ctk.CTkLabel(frame, text="Website / Link:")
link_label.pack(anchor="w", pady=5)

link_entry = ctk.CTkEntry(frame, placeholder_text="Enter URL")
link_entry.pack(fill="x", padx=10)

generate_btn = ctk.CTkButton(app, text="Generate QR Code", command=generate_qr)
generate_btn.pack(pady=20)

QR Image preview
qr_label = ctk.CTkLabel(app, text="")
qr_label.pack(pady=10)

Status message
status_label = ctk.CTkLabel(app, text="", font=("Arial", 14))
status_label.pack(pady=10)

app.mainloop()

-----------------------------------------------------------------------------------------------------

🔵 How to Create QR Code Generator in Python | Free Lifetime QR Code Generator | Python Project

Are you looking to build a QR Code Generator using Python with a modern and beautiful UI? In this video, I’ll walk you step-by-step through creating a complete QR Code Generator App using CustomTkinter, Pillow, and PyQRCode.

Whether you're a beginner in Python or a tech enthusiast, this project is super easy, practical, and fun to build. By the end of this tutorial, you will have your own lifetime free QR code generator software that can generate QR codes for any link or text!

🌟 What You Will Learn

✔ How to design a modern UI using CustomTkinter
✔ How to generate QR codes in Python using PyQRCode
✔ How to save & display QR images
✔ Step-by-step explanation for beginners
✔ Full project overview from UI to functionality

📁 Project Requirements

Python 3

customtkinter

pillow

pyqrcode

🔥 Complete Python Project for Beginners

This is a perfect Python mini project for beginners learning GUI, Python functions, and practical app development.