Day 14 of 100 Days Coding Challenge: Python
I honestly can’t pinpoint when QR codes became part of our daily visual diet. One day, strange hieroglyphics appeared on a poster, and the next, they were everywhere—from ketchup bottles to gravestones.
I’ve been eyeing them for blog promotion—imagine pointing your phone at a code and instantly landing on a beautifully written post (like this one, for example). It’s a hands-free way to impress your friends and confuse your cat. I even considered slapping a QR code on my GitHub repository just for fun. Why type a URL when you can just scan your way into the internet like a wizard?
Today’s Motivation / Challenge
Today’s project taps into one of the most useful real-world tools you can build with Python: a QR code generator. It’s simple, sleek, and satisfying. If you’ve ever wanted to look like a tech-savvy genius without having to build a rocket, this is your moment. Whether you’re promoting your portfolio, sharing your Wi-Fi, or sending someone directly to your meme collection—QR codes make it smooth and snappy.
Purpose of the Code (Object)
This code takes any text—like a URL, message, or even an email—and turns it into a QR code image that anyone can scan. It simplifies how people access your content, and saves you from typing out long, typo-prone links. Think of it as a shortcut to being impressive.
AI Prompt: Please write a code for “QR code generator” in Python. #provide me, description, #main function, #Repositely name. Make it a GUI Version.
Functions & Features
- Takes user input and generates a QR code
- Saves the code as a PNG file
- Let the user choose where to save the file via GUI
- Shows a preview of the generated QR code
Requirements / Setup
Make sure you have Python 3.x and install these packages:
css
CopyEdit
pip install qrcode[pil] Pillow
Minimal Code Sample
qr = qrcode.make(“https://example.com”)
qr.save(“example.png”)
Creates a QR code for the link and saves it as an image file.
Notes / Lessons Learned
The first version of this code worked fine—until I forgot to add “.png” to the filename. The result? A mysterious, extension-less file that no image viewer wanted to be friends with.
Then came the GUI upgrade, which was a game changer. Not only could I see the QR code before saving it, but I could also choose exactly where to drop the file—no more hunting around my project folder like a digital bloodhound. It made the process smoother, less error-prone, and oddly satisfying. I didn’t expect a humble little square to make me feel so accomplished.
Optional Ideas for Expansion
- Add a field to customize QR code color (neon green, anyone?)
- Embed a logo in the center of the QR code for branding
- Create a batch mode to generate QR codes from a list of links in a CSV file

