CAMPO_NEWSLETTER_PUBLISHED=0 MOMENTO_ACTUAL= datetime.datetime.now(datetime.timezone.utc) TIMESTAMP_UNIX_DE_HOY = MOMENTO_ACTUAL.timestamp() # works if Python >= 3.3 ID_LISTA_GENERAL=26 ID_LISTA_CENTROS_GENERAL=12 #Tabla de suscriptores TABLA_SUSCRIPTORES="jos_acymailing_subscriber" #Tabla de listas TABLA_LISTAS="jos_acymailing_list" #La conexion del codigo de lista y de codigo de suscriptor esta en esta tabla TABLA_SUSCRIPTORES_LISTAS="jos_acymailing_listsub" TITULO_BOLETIN="BOLETIN INFORMATIVO DE {0}" gestor_fechas=GestorFechas() (hace_una_semana, hoy)=gestor_fechas.get_rango_fechas_ultima_semana() fecha_hace_una_semana=str(hace_una_semana)[:10] #print (fecha_hace_una_semana) fecha_hoy = str(hoy)[:10] gestor_mysql=GestorMySQL (USUARIO, CLAVE, HOST, BD) filas_historias=gestor_mysql.get_filas( SQL_HISTORIAS_SEMANA.format ( TABLA_HISTORIAS, fecha_hace_una_semana, fecha_hoy)) categorias=get_diccionario_categorias(gestor_mysql) #print (categorias) categoria_actual=-1 boletin="" for f in filas_historias: categoria_fila=f[1]