Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/696bd5cb-0b40-8009-a7e4-526bb5959a3d
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{DISPLAYTITLE:Wi-Fi QR Code Script}} ''This conversation was exported from ChatGPT''<ref>{{cite web|title=Wi-Fi QR Code Script|url=https://chatgpt.com/share/696bd5cb-0b40-8009-a7e4-526bb5959a3d|publisher=ChatGPT|access-date=2026-01-18}}</ref> == gpt-5-2 == === User: can you help me find a python script in github that create qr code that authenticate in a wifi , for exemple i have my … === can you help me find a python script in github that create qr code that authenticate in a wifi , for exemple i have my iphone , and it scan , and it connect to the wifi === Assistant: Yes — here are some GitHub Python projects that generate Wi-Fi QR codes you can use to scan with your iPhone or any pho… === Yes — here are some GitHub Python projects that generate Wi-Fi QR codes you can use to scan with your iPhone (or any phone) to automatically connect to Wi-Fi. These generate standard Wi-Fi QR codes: when scanned by a phone’s camera, it understands the network SSID/password and can join automatically. GitHub<ref>{{cite web|title=GitHub|url=https://github.com/MelonSmasher/WiFiQRGen|publisher=github.com|access-date=2026-01-18}}</ref> ===== #### ===== 📦 [GitHub: lakhanmankani/wifi_qrcode_generator](GitHub: lakhanmankani/wifi_qrcode_generator) A straightforward Python script that generates a Wi-Fi QR code using qrcode and Pillow. You can run it in Python or install as a package. GitHub<ref>{{cite web|title=GitHub|url=https://github.com/lakhanmankani/wifi_qrcode_generator|publisher=github.com|access-date=2026-01-18}}</ref> Features * Generates a QR image for an SSID + password. * Works with standard Wi-Fi formats (WPA, WEP, None). * Easy to use in your own script. Basic usage example (from readme): <syntaxhighlight lang="python">import wifi_qrcode_generator.generator qr_code = wifi_qrcode_generator.generator.wifi_qrcode( ssid='MyNetwork', hidden=False, authentication_type='WPA', password='MyPassword123' ) qr_code.make_image().save('wifi.png') </syntaxhighlight> → Scanning wifi.png with your iPhone camera connects to Wi-Fi. GitHub<ref>{{cite web|title=GitHub|url=https://github.com/lakhanmankani/wifi_qrcode_generator|publisher=github.com|access-date=2026-01-18}}</ref> ====== 📦 [GitHub: vinodvidhole/wifi-qr-code (Notebook)](GitHub: vinodvidhole/wifi-qr-code (Notebook)) ====== A Python notebook that explains and demonstrates generating Wi-Fi QR codes. It’s more of an example/project you can adapt. GitHub<ref>{{cite web|title=GitHub|url=https://github.com/vinodvidhole/wifi-qr-code/blob/main/wifi-qr-code.ipynb|publisher=github.com|access-date=2026-01-18}}</ref> ====== 📦 [GitHub: ustayready/qrwifi](GitHub: ustayready/qrwifi) ====== Another lightweight script that generates a QR PNG from SSID and password, using standard libraries. GitHub<ref>{{cite web|title=GitHub|url=https://github.com/ustayready/qrwifi|publisher=github.com|access-date=2026-01-18}}</ref> ====== If you want a minimal example without a full repo, you can use a gist that just does Wi-Fi QR codes: ====== <syntaxhighlight lang="python">import pyqrcode import sys ssid = "YourNetwork" pwd = "YourPassword" protocol = "WPA" # valid: WPA, WEP, nopass data = f"WIFI:S:{ssid};T:{protocol};P:{pwd};;" qr = pyqrcode.create(data) qr.png(f"{ssid}_wifi.png", scale=5) </syntaxhighlight> This creates a PNG file that phones understand as a Wi-Fi network. Gist<ref>{{cite web|title=Gist|url=https://gist.github.com/GammaGames/7736c7741879e32b5ad2c8b587216445|publisher=gist.github.com|access-date=2026-01-18}}</ref> ===== When you encode a QR with the format <code>WIFI:S:SSID;T:WPA;P:PASSWORD;;</code>, iOS and Android cameras will recognize it and offer to join the Wi-Fi network automatically. Gist<ref>{{cite web|title=Gist|url=https://gist.github.com/GammaGames/7736c7741879e32b5ad2c8b587216445|publisher=gist.github.com|access-date=2026-01-18}}</ref> ===== ===== - These scripts don’t configure your router or network — they just encode your credentials into a standard QR format. ===== * You need to provide correct SSID and password in the script. * When your iPhone scans the generated QR (from screen or print), it will prompt to join the network. If you want, I can also show you how to build a web interface or command-line tool around these scripts to generate QR codes easily! == gpt-5-2-thinking == === User: can you create a python script that do exactly like this but it use tkinter with a nice userfriendly interface === can you create a python script that do exactly like this but it use tkinter with a nice userfriendly interface === Assistant: Absolutely — here’s a single-file Python script that gives you a nice Tkinter GUI to generate a Wi-Fi QR code scan with… === Absolutely — here’s a single-file Python script that gives you a nice Tkinter GUI to generate a Wi-Fi QR code (scan with iPhone camera → it prompts to join the network). ===== Install dependencies ===== <syntaxhighlight lang="bash">pip install qrcode[pil] pillow </syntaxhighlight> ===== wifi_qr_gui.py ===== <syntaxhighlight lang="python">import tkinter as tk from tkinter import ttk, filedialog, messagebox import qrcode from PIL import Image, ImageTk def escape_wifi_text(s: str) -> str: """ Escape special chars per common WiFi QR conventions. Many scanners expect \ for: \ ; , : " """ if s is None: return "" return ( s.replace("\\", "\\\\") .replace(";", r"\;") .replace(",", r"\,") .replace(":", r"\:") .replace('"', r"\"") ) def build_wifi_payload(ssid: str, auth: str, password: str, hidden: bool) -> str: # auth: "WPA", "WEP", "nopass" ssid_e = escape_wifi_text(ssid.strip()) pwd_e = escape_wifi_text(password) # Standard format: # WIFI:S:<ssid>;T:<auth>;P:<password>;H:<hidden>;; # H is optional; include for clarity if auth == "nopass": payload = f"WIFI:S:{ssid_e};T:nopass;P:;H:{'true' if hidden else 'false'};;" else: payload = f"WIFI:S:{ssid_e};T:{auth};P:{pwd_e};H:{'true' if hidden else 'false'};;" return payload class WifiQRApp(tk.Tk): def __init__(self): super().__init__() self.title("Wi-Fi QR Code Generator") self.geometry("780x520") self.minsize(740, 480) # App state self.qr_pil = None self.qr_tk = None self._build_ui() def _build_ui(self): # Style style = ttk.Style(self) try: self.tk.call("tk", "scaling", 1.0) except Exception: pass container = ttk.Frame(self, padding=16) container.pack(fill="both", expand=True) # Layout: left form, right preview container.columnconfigure(0, weight=1) container.columnconfigure(1, weight=2) container.rowconfigure(0, weight=1) left = ttk.Frame(container) right = ttk.Frame(container) left.grid(row=0, column=0, sticky="nsew", padx=(0, 12)) right.grid(row=0, column=1, sticky="nsew") # ---- Left: Form ---- title = ttk.Label(left, text="Create a Wi-Fi QR code", font=("Segoe UI", 16, "bold")) title.pack(anchor="w", pady=(0, 12)) form = ttk.Frame(left) form.pack(fill="x", pady=(0, 10)) # SSID ttk.Label(form, text="Network name (SSID)").grid(row=0, column=0, sticky="w") self.ssid_var = tk.StringVar() self.ssid_entry = ttk.Entry(form, textvariable=self.ssid_var) self.ssid_entry.grid(row=1, column=0, sticky="ew", pady=(4, 10)) # Auth ttk.Label(form, text="Security").grid(row=2, column=0, sticky="w") self.auth_var = tk.StringVar(value="WPA") self.auth_combo = ttk.Combobox( form, textvariable=self.auth_var, values=["WPA", "WEP", "nopass"], state="readonly" ) self.auth_combo.grid(row=3, column=0, sticky="ew", pady=(4, 10)) self.auth_combo.bind("<<ComboboxSelected>>", lambda e: self._sync_password_state()) # Password ttk.Label(form, text="Password").grid(row=4, column=0, sticky="w") self.pwd_var = tk.StringVar() self.pwd_entry = ttk.Entry(form, textvariable=self.pwd_var, show="•") self.pwd_entry.grid(row=5, column=0, sticky="ew", pady=(4, 6)) # Show password self.show_pwd_var = tk.BooleanVar(value=False) show_pwd = ttk.Checkbutton( form, text="Show password", variable=self.show_pwd_var, command=self._toggle_password_visibility ) show_pwd.grid(row=6, column=0, sticky="w", pady=(0, 10)) # Hidden network self.hidden_var = tk.BooleanVar(value=False) hidden_cb = ttk.Checkbutton(form, text="Hidden network (SSID not broadcast)", variable=self.hidden_var) hidden_cb.grid(row=7, column=0, sticky="w", pady=(0, 12)) form.columnconfigure(0, weight=1) # Buttons btns = ttk.Frame(left) btns.pack(fill="x", pady=(4, 0)) gen_btn = ttk.Button(btns, text="Generate QR", command=self.generate_qr) gen_btn.pack(side="left", fill="x", expand=True) save_btn = ttk.Button(btns, text="Save PNG…", command=self.save_png) save_btn.pack(side="left", fill="x", expand=True, padx=(10, 0)) # Tip tip = ttk.Label( left, text="Tip: On iPhone, open the Camera and scan the QR.\nIt should prompt: “Join <SSID>”.", foreground="#555" ) tip.pack(anchor="w", pady=(14, 0)) # ---- Right: Preview ---- preview_card = ttk.Frame(right, padding=12) preview_card.pack(fill="both", expand=True) ttk.Label(preview_card, text="Preview", font=("Segoe UI", 12, "bold")).pack(anchor="w", pady=(0, 8)) self.preview_area = tk.Canvas(preview_card, bg="white", highlightthickness=1, highlightbackground="#ddd") self.preview_area.pack(fill="both", expand=True) self.payload_text = tk.Text(preview_card, height=3, wrap="word") self.payload_text.pack(fill="x", pady=(10, 0)) self.payload_text.configure(state="disabled") self._sync_password_state() self.ssid_entry.focus_set() # Regenerate on Enter self.bind("<Return>", lambda e: self.generate_qr()) # Handle resizing of preview nicely self.preview_area.bind("<Configure>", lambda e: self._redraw_preview()) def _toggle_password_visibility(self): self.pwd_entry.configure(show="" if self.show_pwd_var.get() else "•") def _sync_password_state(self): auth = self.auth_var.get() if auth == "nopass": self.pwd_entry.configure(state="disabled") self.pwd_var.set("") else: self.pwd_entry.configure(state="normal") def _set_payload_display(self, payload: str): self.payload_text.configure(state="normal") self.payload_text.delete("1.0", "end") self.payload_text.insert("1.0", payload) self.payload_text.configure(state="disabled") def generate_qr(self): ssid = self.ssid_var.get().strip() auth = self.auth_var.get().strip() password = self.pwd_var.get() if not ssid: messagebox.showerror("Missing SSID", "Please enter a network name (SSID).") return if auth in ("WPA", "WEP") and not password: messagebox.showerror("Missing password", f"Security is set to {auth}. Please enter the Wi-Fi password.") return payload = build_wifi_payload(ssid, auth, password, self.hidden_var.get()) self._set_payload_display(payload) # Build QR qr = qrcode.QRCode( version=None, error_correction=qrcode.constants.ERROR_CORRECT_M, box_size=10, border=4 ) qr.add_data(payload) qr.make(fit=True) img = qr.make_image(fill_color="black", back_color="white").convert("RGB") self.qr_pil = img self._redraw_preview() def _redraw_preview(self): self.preview_area.delete("all") if self.qr_pil is None: self.preview_area.create_text( 10, 10, anchor="nw", text="Generate a QR code to preview it here.", fill="#666", font=("Segoe UI", 11) ) return # Fit the QR into the canvas with padding cw = max(self.preview_area.winfo_width(), 1) ch = max(self.preview_area.winfo_height(), 1) pad = 20 max_w = max(cw - 2 * pad, 50) max_h = max(ch - 2 * pad, 50) img = self.qr_pil.copy() img.thumbnail((max_w, max_h), Image.Resampling.LANCZOS) self.qr_tk = ImageTk.PhotoImage(img) x = cw // 2 y = ch // 2 self.preview_area.create_image(x, y, image=self.qr_tk, anchor="center") def save_png(self): if self.qr_pil is None: messagebox.showinfo("Nothing to save", "Generate a QR code first.") return ssid = self.ssid_var.get().strip() or "wifi_qr" default_name = f"{ssid}_wifi_qr.png".replace(" ", "_") path = filedialog.asksaveasfilename( defaultextension=".png", filetypes=[("PNG Image", "*.png")], initialfile=default_name, title="Save QR code as PNG" ) if not path: return try: self.qr_pil.save(path, format="PNG") messagebox.showinfo("Saved", f"Saved QR code to:\n{path}") except Exception as e: messagebox.showerror("Save failed", f"Could not save the file:\n{e}") if __name__ == "__main__": app = WifiQRApp() app.mainloop() </syntaxhighlight> ===== How to use ===== # Run: python wifi_qr_gui.py # Enter SSID, choose WPA/WEP/nopass, enter password if needed # Click Generate QR # Point your iPhone camera at the QR → it should offer to join the Wi-Fi If you want, I can also add: dark mode, copy QR to clipboard, auto-detect SSID on your computer, or a “print” layout. == References == <references /> [[Category:ChatGPT Shares]] [[Category:openai]]
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Cite web
(
edit
)
Module:Citation/CS1
(
edit
)
Module:Citation/CS1/COinS
(
edit
)
Module:Citation/CS1/Configuration
(
edit
)
Module:Citation/CS1/Date validation
(
edit
)
Module:Citation/CS1/Identifiers
(
edit
)
Module:Citation/CS1/Utilities
(
edit
)
Module:Citation/CS1/Whitelist
(
edit
)
Module:Citation/CS1/styles.css
(
edit
)