Advertisement
Guest User

/shrug

a guest
Oct 23rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. def lire (filename):
  2.     t = open(filename ,"r")
  3.     while 1:
  4.         txt = t.readline()
  5.         print(txt)
  6.         if txt =='':
  7.             break
  8.     t.close()
  9.  
  10. def write(filename):
  11.     t = open(filename,"a")
  12.     txt = t.write(Edit)
  13.     t.close()
  14.  
  15.  
  16. fname = input("Quel fichier voulez-vous open ? --> ")
  17. NANI = input('Edition ou Lecture ?')
  18. if NANI == 'Edition':
  19.     Edit = input("Que voulez-vous écrire ? : ")
  20.     write(fname)
  21.     while Edit != '':
  22.         Edit = input("Que voulez-vous écrire ? : ")
  23.         write(fname)
  24. elif NANI == "Lecture":
  25.     lire(fname)
  26. else:
  27.     print("Fonction inconnue ,vérifiez l'orthographe")
  28.  
  29. OULAH = input("Pressez entrer pour sortir.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement