acecalisto3 commited on
Commit
3dbae08
·
verified ·
1 Parent(s): fe14e10

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +11 -1
app2.py CHANGED
@@ -389,7 +389,17 @@ def generate_qr(json_data):
389
 
390
  return interface
391
 
392
- def main():
 
 
 
 
 
 
 
 
 
 
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