Spaces:
Runtime error
Runtime error
Commit ·
ea78763
1
Parent(s): 1f4e2ec
wifi
Browse files
wifi.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import segno.helpers as hp
|
| 2 |
+
import gradio as gr
|
| 3 |
+
from PIL import Image
|
| 4 |
+
|
| 5 |
+
def qr_code_generator(ssid, password = None):
|
| 6 |
+
qr_code = hp.make_wifi(ssid = ssid, password = password, security = 'WPA')
|
| 7 |
+
qr_code.save('temp.png', scale = 10)
|
| 8 |
+
Im = Image.open('temp.png')
|
| 9 |
+
return Im
|
| 10 |
+
|
| 11 |
+
iface = gr.Interface(fn=qr_code_generator,
|
| 12 |
+
inputs = [gr.inputs.Textbox(label = 'SSID'), gr.inputs.Textbox(label = 'Password')],
|
| 13 |
+
outputs = 'image', allow_flagging = False)
|
| 14 |
+
|
| 15 |
+
iface.launch()
|