Pouknouki

Comptage des fichiers

Oct 31st, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. def calculerNombreDeFichiers(dossier):
  2.     renvoye = 0
  3.     for x in os.listdir(dossier):
  4.         if os.path.isdir(x):
  5.             renvoye += calculerNombreDeFichiers(dossier + "/" + x)
  6.         else:
  7.             renvoye += 1
  8.  
  9.     return renvoye
Advertisement
Add Comment
Please, Sign In to add comment