jtorresj96 commited on
Commit
60bd708
路
verified 路
1 Parent(s): fcadacd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -3,6 +3,7 @@ import requests
3
  import gradio as gr
4
  import gspread
5
  from google.oauth2.service_account import Credentials
 
6
 
7
  # Autenticaci贸n con Google Sheets usando el archivo credentials.json
8
  scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
@@ -46,8 +47,9 @@ def send_sms(iccid, text):
46
 
47
  def save_to_google_sheets(iccid, placa, imei, operario):
48
  """Guarda los datos en Google Sheets."""
 
49
  try:
50
- sheet.append_row([iccid, placa, imei, operario])
51
  print("Datos guardados exitosamente en Google Sheets.")
52
  except Exception as e:
53
  print(f"Error al guardar en Google Sheets: {e}")
 
3
  import gradio as gr
4
  import gspread
5
  from google.oauth2.service_account import Credentials
6
+ from datetime import datetime
7
 
8
  # Autenticaci贸n con Google Sheets usando el archivo credentials.json
9
  scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
 
47
 
48
  def save_to_google_sheets(iccid, placa, imei, operario):
49
  """Guarda los datos en Google Sheets."""
50
+ fecha_actual = datetime.now().strftime('%Y-%m-%d')
51
  try:
52
+ sheet.append_row([iccid, placa, imei, operario, fecha_actual])
53
  print("Datos guardados exitosamente en Google Sheets.")
54
  except Exception as e:
55
  print(f"Error al guardar en Google Sheets: {e}")