Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pyqrcode
|
| 3 |
+
|
| 4 |
+
def generate_qr(text):
|
| 5 |
+
qr_code = pyqrcode.create(text)
|
| 6 |
+
qr_code.png("QRCode.png", scale=10)
|
| 7 |
+
return "QRCode.png"
|
| 8 |
+
|
| 9 |
+
iface = gr.Interface(
|
| 10 |
+
fn=generate_qr,
|
| 11 |
+
inputs=gr.Textbox(label="Enter text or link to generate QR Code"),
|
| 12 |
+
outputs=gr.Image(type="filepath", label="Generated QR Code"),
|
| 13 |
+
title="QR Code Generator",
|
| 14 |
+
description="Enter any text or link to generate a QR Code."
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
iface.launch(share=True) # Enables public sharing
|