Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import qrcode
|
3 |
+
|
4 |
+
def url_to_qr(url):
|
5 |
+
qr = qrcode.QRCode(version=1, error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=4)
|
6 |
+
qr.add_data(url)
|
7 |
+
qr.make(fit=True)
|
8 |
+
qr_img = qr.make_image(fill_color="black", back_color="white")
|
9 |
+
return qr_img
|
10 |
+
|
11 |
+
iface = gr.Interface(fn=url_to_qr, inputs="text", outputs="image")
|
12 |
+
iface.launch()
|