schroneko commited on
Commit
604278f
·
1 Parent(s): 1bce21f

Add application file

Browse files
Files changed (2) hide show
  1. app.py +19 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import qrcode
3
+
4
+ def generate_wifi_qr(ssid, encryption, password):
5
+ wifi_data = f"WIFI:S:{ssid};T:{encryption};R:1;P:{password};;"
6
+ qr = qrcode.make(wifi_data)
7
+ return qr.get_image()
8
+
9
+ iface = gr.Interface(
10
+ fn=generate_wifi_qr,
11
+ inputs=[
12
+ gr.Textbox(label="SSID"),
13
+ gr.Dropdown(["WPA", "WEP"], label="Encryption"),
14
+ gr.Textbox(label="Password")
15
+ ],
16
+ outputs="image"
17
+ )
18
+
19
+ iface.launch(debug=True)
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ gradio
2
+ qrcode