File size: 546 Bytes
d55fca9 efc8a0c c1f6033 efc8a0c c1f6033 d55fca9 c1f6033 efc8a0c d55fca9 c1f6033 d55fca9 c59551f d55fca9 efc8a0c d55fca9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
import pyqrcode
import os
# Function to generate QR code and save as an image file
def generate_qr_code(link):
url = pyqrcode.create(link)
file_name = "myqrcode.png"
url.png(file_name, scale=10)
return file_name
# Create Gradio Interface
iface = gr.Interface(
fn=generate_qr_code,
inputs=gr.inputs.Textbox(lines=2, placeholder="Enter URL Here..."),
outputs="image",
title="QR Code Generator",
description="Paste a link and generate its QR code."
)
# Launch the interface
iface.launch()
|