You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
988 B

from rue import dessiner_rue_decrite
def separateur(fichier:str) -> list[list]:
t = []
obj_fichier = open(fichier, 'r', encoding="utf-8")
ligne = 'test'
while ligne != "":
ligne = obj_fichier.readline()
ligne = ligne.replace('\n','')
parametre = ligne.split(';')
t.append(parametre)
return t
def recuperer_immeuble(t:list) -> dict:
informations = {}
informations['numero'] = int(t[0])
informations['couleur_facade'] = t[1]
informations['etages'] = int(t[2])
informations['toit'] = t[3]
informations['porte'] = t[4]
return informations
def recuperer_immeubles(tab:list[list]) -> list[dict]:
rep = []
for i in range(len(tab) - 1):
dico = recuperer_immeuble(tab[i])
rep.append(dico)
return rep
rue_tab = separateur('text_interpreteur.txt')
rue_dict = recuperer_immeubles(rue_tab)
dessiner_rue_decrite(rue_dict)