Spaces:
Running
Running
Update app2.py
Browse files
app2.py
CHANGED
@@ -389,7 +389,17 @@ def generate_qr(json_data):
|
|
389 |
|
390 |
return interface
|
391 |
|
392 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
# Configure system settings
|
394 |
mimetypes.init()
|
395 |
|
|
|
389 |
|
390 |
return interface
|
391 |
|
392 |
+
import qrcode # Import the qrcode library
|
393 |
+
|
394 |
+
def generate_qr(json_data):
|
395 |
+
"""Generate QR code from JSON data and return the file path."""
|
396 |
+
if json_data:
|
397 |
+
qr = qrcode.make(json_data)
|
398 |
+
qr_path = f"output/qr_code_{int(time.time())}.png"
|
399 |
+
qr.save(qr_path)
|
400 |
+
return qr_path
|
401 |
+
return None
|
402 |
+
|
403 |
# Configure system settings
|
404 |
mimetypes.init()
|
405 |
|