DirFileList
Publicado por N 06/11/2006
[ Hits: 4.603 ]
Cria uma lista com todos os arquivos de um determinado diretório recursivamente.
Nycholas de Oliveira e Oliveira - o_lalertom - nycholas@gmail.com
# -*- coding: utf-8 -*- import os import string class DirFileList: def __init__(self): self._dirFileList = [] def __listDirs(self, path): try: if os.path.isfile(path) is True: self._dirFileList.append(path) else: abspath = map(lambda x: os.path.join(path, x), os.listdir(path)) if abspath is not []: map(lambda x: self.__listDirs(x), abspath) except: self._dirFileList.extend(path) def getDirFileList(self): return self._dirFileList def setDirFileList(self, path): self.__listDirs(path) dirFileList = property(fget=getDirFileList, fset=setDirFileList) class _TestDirFileList: def __init__(self): self._dirFileList = DirFileList() self._dirFileList.setDirFileList("/home") print self._dirFileList.getDirFileList() if __name__ == "__main__": _TestDirFileList()
Atualizar o macOS no Mac - Opencore Legacy Patcher
Crie alias para as tarefas que possuam longas linhas de comando - bash e zsh
Criando um gateway de internet com o Debian
Configuração básica do Conky para mostrar informações sobre a sua máquina no Desktop
Aprenda a criar músicas com Inteligência Artificial usando Suno AI
Como instalar o navegador TOR no seu Linux
Instalando Zoom Client no Ubuntu 24.04 LTS
Instalando Zoom Client no Fedora 40
Instalando Navegador Firefox no Debian 12
Bloqueando propagandas no Youtube e outros sites com o uBlocker Origin