Python PartB[1]
Python PartB[1]
QR Code Genrator
1.0 Rationale
Creating a QR code generator in Python serves multiple purposes, addressing the widespread use
and versatility of QR codes in modern society. QR codes have become integral for sharing diverse
types of information, from website URLs to contact details, making a generator a valuable tool
for both individuals and businesses. By developing such a tool, users gain autonomy in generating
customized QR codes tailored to their specific needs, ensuring convenience and flexibility.
Moreover, a locally executed generator prioritizes user privacy and security by eliminating the
need to transmit sensitive data over the internet to external services, enhancing user trust and
confidence in the process.
def generate_qr_code():
link = entry_link.get()
if link:
qr = qrcode.QRCode(version=1, box_size=custom_box_size.get(), border=5)
qr.add_data(link)
qr.make(fit=True)
img = qr.make_image(fill='black', back_color=custom_bg_color.get())
img = img.resize((300, 300), Image.LANCZOS)
img = ImageTk.PhotoImage(img)
qr_label.config(image=img)
qr_label.image = img
messagebox.showinfo("Success", "QR Code generated successfully!")
else:
messagebox.showerror("Error", "Please enter a link.")
def select_bg_color():
color = colorchooser.askcolor()[1]
custom_bg_color.set(color)
# GUI setup
root = tk.Tk()
root.title("QR Code Generator")
root.geometry("400x500")
root.configure(bg='#FFA500') # Set background color to orange
# Heading Label
heading_label = tk.Label(root, text="QR Code Generator", font=("Helvetica", 18), bg='#FFA500')
heading_label.pack(pady=10)
# Customization Options
custom_box_size = tk.IntVar()
custom_box_size.set(10) # Default box size
custom_bg_color = tk.StringVar()
custom_bg_color.set('white') # Default background color
# Generate Button
button_generate = tk.Button(root, text="Generate QR Code", command=generate_qr_code, font=("Helvetica",
12), bg='#4CAF50', fg='white')
button_generate.pack(pady=10)
root.mainloop()
6.0Actual Resources Used
Sr. Name of Specifications Quantity
No. Resource/material
1 Lenovo Intel ®core™ i3 CPU @ 3.20 GHz
Laptop/PC with Internet. 01
Windows 7
2 Microsoft Office Word 2007/2019 01
3 TextEditor IDLE(3.12 64-Bit) 01
4 JavaScript Demystified
Jim Keogh 01
3. Event Ticketing and Registration:- QR codes streamline event ticketing and registration
processes by serving as digital tickets or registration confirmations. Event organizers generate QR
codes for each ticket or registration, which attendees can present for entry or verification. This
eliminates the need for physical tickets or manual check-ins, enhancing efficiency and reducing
administrative overhead.
4. Inventory and Asset Management:- QR codes are utilized for inventory and asset
management in various industries, including retail, manufacturing, logistics, and healthcare. Each
product, item, or asset is assigned a unique QR code that contains relevant information such as serial
numbers, locations, maintenance history, or tracking details. QR code generators enable organizations
to create and manage codes efficiently, facilitating accurate inventory tracking and asset monitoring.
5. Authentication and Access Control: - QR codes are employed for authentication and
access control in applications such as two-factor authentication (2FA), login verification, or secure
document access. Users generate QR codes linked to their accounts or credentials, which they can
scan using authentication apps or devices to verify their identity securely. This enhances security by
adding an additional layer of verification beyond traditional passwords or PINs.