1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
for rw in data_rows:
tranch = f'{str(rw[1])} - {str(rw[2])}'
liste_matieres.append(rw[0])
liste_matieres_par_tranche.append(f"'{rw[0]}','{str(rw[1])} - {str(rw[2])}'")
liste_matieres_par_tranche_par_jour.append(f'("{rw[0]}","{tranch}","{str(rw[3])}")')
if tranch not in liste_tranche_horaire:
liste_tranche_horaire.append(f'{str(rw[1])} - {str(rw[2])}')
# Un test sur chaque élément:
print("liste_matieres", liste_matieres)
print("liste_tranche_horaire", liste_tranche_horaire)
print("liste_matieres_par_tranche", liste_matieres_par_tranche)
print("liste_matieres_par_tranche_par_jour", liste_matieres_par_tranche_par_jour)
# Me donne:
# liste_matieres ['Algo-101', 'Algo-101', 'Algo-101', ....']
# liste_tranche_horaire ['08:00 - 09:00', '09:00 - 10:00', ..., '17:00 - 18:00']
# liste_matieres_par_tranche ["'Algo-101','08:00 - 09:00'", "'Algo-101','09:00 - 10:00'", "'Algo-101','10:00 - 11:00'", "'Math-101','11:00 - 12:00'", ..., "'PYP-101','11:00 - 12:00'"]
# liste_matieres_par_tranche_par_jour ['("Algo-101","08:00 - 09:00","Mardi")', '("Algo-101","09:00 - 10:00","Mardi")', '("Algo-101","10:00 - 11:00","Mardi")', '("Algorithmique 202","11:00 - 12:00","Mardi")', '("PYP-101","08:00 - 09:00","Mercredi")', ..., '("PYP-101","11:00 - 12:00","Lundi")'] |
Partager