Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.66 KB | None | 0 0
  1. texte_retour = []                                                                                
  2. with open('La_Karavano.txt', 'r') as txt:                                                        
  3.     line = txt.readline()                                                                        
  4.     while (line != ""):                                                                          
  5.         texte_retour.append(line)                                                                
  6.         line = txt.readline()                                                                    
  7.                                                                                                  
  8. with open('new_Karavano.txt', 'w') as flow:                                                      
  9.     longueur = len(texte_retour)                                                                  
  10.     num = 0                                                                                      
  11.     while (num != longueur):                                                                      
  12.         mots = texte_retour[num].split()                                                          
  13.         flow.write(str(num + 1) + ";" + str(len(mots)) + ";" + texte_retour[num])                
  14.         num += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement