Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import os
- class FileManager():
- def __init__(self, _masterPath):
- self.masterPath = _masterPath
- self.loadFiles(self.masterPath)
- #Récupération de tous les fichiers pour l'insertion
- def loadFiles(self, path):
- #Si c'est un FICHIER
- if os.path.isfile(path):
- #Sinon, c'est un DOSSIER
- else:
- #Donc pour chaque élément dans ce dossier, récursivité sur la fonction
- for file in os.listdir(path):
- self.loadFiles(os.path.join(path, file))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement