Created
November 17, 2022 00:33
-
-
Save gilillo32/4fc381ad07e1880a75d69641b84be818 to your computer and use it in GitHub Desktop.
¿Harto de entrar carpeta a carpeta para ver si los chavalucos han traído su documentación para el campa? ¡Ejecuta este script donde estén las carpetas y en menos de un segundo tendrás la respuesta que buscas!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
def main(): | |
medi = re.compile(".*medicamentos*", re.I) | |
osaki = re.compile(".*osaki*", re.I) | |
cont = 0 | |
for (root, dirs, files) in os.walk('.'): | |
if not ('general' in root.lower() or '.' == root): | |
cont += 1 | |
listaMedicamentos = list(filter(medi.match, files)) | |
listaOsakis = list(filter(osaki.match, files)) | |
if not listaMedicamentos: | |
print(root + " FALTA MEDICAMENTOS") | |
if not listaOsakis: | |
print(root + " FALTA OSAKIDETZA") | |
if not listaOsakis or not listaMedicamentos: print('\n') | |
print('\n' + str(cont) + " niñes analizados. Comprueba que el número coincide con tus listas.\n") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment