Estimated reading time at 200 wpm: 10 minutes
QR codes are particularly valuable in documents where traditional hyperlinks cannot be made clickable or directly exposed, such as printed materials, posters, handouts, slides or certain electronic files intended for distribution. A QR code, or Quick Response code, is a two-dimensional barcode capable of storing a hyperlink or other information. When scanned by a smartphone camera or dedicated QR reader, it instantly opens the encoded link without the need for manual typing.
Whether or not you agree our Fat Disclaimer applies
Some professionals will find that they ought not to be using a) internet based services for QR code generation or b) installed applications that share information – unbeknownst to anyone – to unknown sources. Yes – ‘people’ get away with all sorts of things these days but it only takes that ‘one in million chance’ and your career is over! The solution is to have an application that is totally local and not connected to the internet by any imaginable means. Well, if you have money to spend you can run out there and buy something. But even if I can afford something does not mean I will part with my cash. So I built the app – and wait – I’m no coder or programmer!
WARNING: If you try this on your computer and it blows up, or you end up with PTSD – your only option is to sue yourself!
Why a Local QR Code Generator Was Built
First – I did not want to put money is somebody else’s pocket. Call me stingy – I’ve been called worse!
Then, a trawl of the internet brings up numerous options for generating QR codes, for absolute security local generation of QR codes is best, as hyperlinks are not posted or travelling through the internet. Online QR code generators, while convenient, require the full hyperlink to be transmitted to third-party servers for processing. This can introduce risks such as logging, caching, or unintended exposure of the link, even if only temporarily. A local QR code generator was therefore built to eliminate these concerns entirely. All encoding happens directly on the local machine, ensuring that the hyperlink never travels through the internet or leaves the device. This method provides absolute privacy and security for any hyperlink, making it ideal for creating QR codes that will be inserted into electronic documents or printed materials where traditional clickable links are not possible or desirable.
Step 1: Create the Dedicated Application Folder
A dedicated folder should be created inside C:\MY_APPLICATIONS to store the files for the USER Custom QR Generator application.
- Press the Windows key + E to open File Explorer.
- Navigate to the C:\MY_APPLICATIONS folder.
- Right-click in an empty area inside the folder, select New → Folder.
- Name the new folder exactly USER-custom-QR and press Enter.
Step 2: Install the Required Library
The qrcode library with Pillow support must be installed inside the dedicated folder.
- Press the Windows key + R, type
cmdand press Enter to open Command Prompt. - Change into the newly created folder by copying and pasting the following command, then pressing Enter:cd C:\MY_APPLICATIONS\USER-custom-QR
- Install the required library by copying and pasting this command, then pressing Enterpip install qrcode[pil]The installation completes when the message “Successfully installed qrcode” appears. The command prompt may then be closed.
Step 3: Create the GUI Python Script
The main GUI Python script for the USER Custom QR Generator should be created inside the USER-custom-QR folder using a text editor such as Notepad++.
- Open Notepad++.
- Create a new file.
- Copy the entire code below and paste it into the editor.
- Save the file as
USER_custom_QR.pyinsideC:\MY_APPLICATIONS\USER-custom-QR. Ensure “All Files (.)” is selected as the save type.
import tkinter as tk
from tkinter import filedialog, messagebox
import qrcode
from qrcode.constants import ERROR_CORRECT_H
from PIL import Image, ImageTk
import os
class USER_QR_Generator:
def __init__(self):
self.root = tk.Tk()
self.root.title("USER Custom QR Generator")
self.root.geometry("700x780")
self.root.resizable(False, False)
# Store the current QR image so it doesn't disappear
self.current_qr_image = None
self.current_qr_pil = None
# Title
title = tk.Label(self.root, text="USER Custom QR Generator", font=("Arial", 18, "bold"))
title.pack(pady=15)
# Instructions
tk.Label(self.root, text="Paste the full hyperlink below:",
font=("Arial", 12)).pack(pady=5)
# URL entry box
self.url_entry = tk.Entry(self.root, width=80, font=("Arial", 11))
self.url_entry.pack(pady=8, padx=20)
# Generate button
generate_btn = tk.Button(self.root, text="Generate QR Code & Preview",
font=("Arial", 12, "bold"), bg="#4CAF50", fg="white",
command=self.generate_qr)
generate_btn.pack(pady=15)
# Preview area
self.preview_label = tk.Label(self.root, text="QR Code Preview will appear here\nafter you click Generate",
font=("Arial", 10), relief="solid", width=50, height=8)
self.preview_label.pack(pady=10)
# Save button (disabled until a QR is generated)
self.save_btn = tk.Button(self.root, text="Save QR Code As PNG...",
font=("Arial", 12), bg="#2196F3", fg="white",
command=self.save_qr, state="disabled")
self.save_btn.pack(pady=20)
# Footer note
tk.Label(self.root, text="✅ Everything runs locally on the computer\n"
"Hyperlinks are never sent anywhere",
font=("Arial", 9), fg="gray").pack(side="bottom", pady=20)
self.root.mainloop()
def generate_qr(self):
url = self.url_entry.get().strip()
if not url:
messagebox.showwarning("Empty URL", "Please paste a hyperlink first!")
return
try:
# Create high-quality QR
qr = qrcode.QRCode(version=None, error_correction=ERROR_CORRECT_H,
box_size=15, border=4)
qr.add_data(url)
qr.make(fit=True)
self.current_qr_pil = qr.make_image(fill_color="black", back_color="white")
# Show preview in the window
preview_img = self.current_qr_pil.resize((400, 400))
self.current_qr_image = ImageTk.PhotoImage(preview_img)
self.preview_label.config(image=self.current_qr_image, text="")
self.save_btn.config(state="normal")
messagebox.showinfo("Success", "QR code generated! Ready to save.")
except Exception as e:
messagebox.showerror("Error", f"Something went wrong:\n{str(e)}")
Step 4: Turn It Into a Double-Clickable Windows App (No Terminal Window)
The script must be renamed and a shortcut created so the application opens with a single double-click and without any Command Prompt window appearing.
- In File Explorer, navigate to
C:\MY_APPLICATIONS\USER-custom-QR. - Right-click the file
USER_custom_QR.pyand rename it toUSER_custom_QR.pyw. Confirm the extension change if prompted. - Open Command Prompt (Windows key + R, type
cmd, press Enter). 4. Run the following command to locate the correct Python executable: where pythonw - Copy the full path that appears (for example: C:\Users\Username\miniconda3\pythonw.exe).
- Right-click on an empty area of the Desktop and select New → Shortcut.
- In the location box, paste the following (replace the example path with the exact path from step 4): “C:\Users\Username\miniconda3\pythonw.exe” “C:\MY_APPLICATIONS\USER-custom-QR\USER_custom_QR.pyw”
- Click Next, name the shortcut USER Custom QR, and click Finish.
- Double-click the new shortcut to test that the USER Custom QR Generator window opens cleanly with no terminal window.
Step 5: How to Use the USER Custom QR Generator
The USER Custom QR Generator is launched by double-clicking the shortcut created earlier. The main window opens with a text entry box at the top.
- The complete hyperlink is pasted into the text box.
- The button labelled Generate QR Code & Preview is clicked.
- A large preview of the QR code appears in the centre of the window.
- Once satisfied with the preview, the button labelled Save QR Code As PNG… is clicked.
- A standard save dialogue opens. The default filename USER_QR_code.png can be kept or changed, and the desired folder location is selected.
- The Save button is clicked in the dialogue to store the high-resolution PNG file locally.
The QR code is now ready for insertion into electronic documents or printed materials. The process is repeated for each new hyperlink.
Step 6: Placing Shortcuts Anywhere on the Computer
Once the working shortcut has been created on the Desktop, additional copies can be placed in any convenient location.
- The shortcut on the Desktop is right-clicked and Copy is selected.
- File Explorer is opened and the desired folder is navigated to (for example, a project folder, Documents, or another location).
- Inside the chosen folder, right-click is performed and Paste Shortcut is selected.
The shortcut can be renamed if required by right-clicking it, selecting Rename, and entering a new name. Every copy functions identically and opens the application directly without a Command Prompt window.
Optional Improvements That Can Be Added Later
Several enhancements can be made to the USER Custom QR Generator after the basic version is running. Common improvements include embedding a custom logo in the centre of the QR code, replacing the default Python icon with a more professional application icon, configuring automatic saving into a dedicated sub-folder, and adding support for different colour schemes or error correction levels. Each of these features can be implemented through small modifications to the Python script.
Final Thoughts
A locally executed QR code generator delivers a secure, efficient, and private solution for converting hyperlinks into QR codes. The USER Custom QR Generator, once properly configured, provides a clean and consistent workflow suitable for regular use. The combination of complete data control, simplicity of operation, and freedom from third-party dependencies makes this approach an excellent choice for anyone requiring reliable QR codes.











