Correction de la lecture des espaces, question 2
This commit is contained in:
parent
46b2f2d82a
commit
489751f2fe
|
@ -107,7 +107,7 @@ def lire_donnees(num_descr):
|
|||
|
||||
i=0
|
||||
tmp=''
|
||||
while(contenu[0][i] != ':'):
|
||||
while(contenu[0][i] != ' '):
|
||||
tmp += contenu[0][i]
|
||||
i+=1
|
||||
|
||||
|
@ -115,7 +115,7 @@ def lire_donnees(num_descr):
|
|||
|
||||
#On lit la hauteur
|
||||
|
||||
i+=1
|
||||
i+=2
|
||||
tmp=''
|
||||
while(contenu[0][i] != '\n'):
|
||||
tmp += contenu[0][i]
|
||||
|
@ -131,11 +131,11 @@ def lire_donnees(num_descr):
|
|||
nom=''
|
||||
tailleStr=''
|
||||
j=0
|
||||
while(contenu[i][j] != ':'):
|
||||
while(contenu[i][j] != ' '):
|
||||
nom += contenu[i][j]
|
||||
j+=1
|
||||
|
||||
j+=1
|
||||
j+=2
|
||||
while(contenu[i][j] != '\n'):
|
||||
tailleStr += contenu[i][j]
|
||||
j +=1
|
||||
|
@ -145,8 +145,14 @@ def lire_donnees(num_descr):
|
|||
return res
|
||||
|
||||
#test OK
|
||||
print(lire_donnees('2'))
|
||||
print(lire_donnees('1'))
|
||||
#
|
||||
#
|
||||
|
||||
#Fichier personnalisé
|
||||
prin(lire_donnees('3'))
|
||||
#
|
||||
|
||||
|
||||
|
||||
def sauver_result (nom, jeu, nbre):
|
||||
|
|
Reference in a new issue