We Recommend

Learning Python Learning Python
The authors of Learning Python show you enough essentials of the Python scripting language to enable you to begin solving problems right away, then reveal more powerful aspects of the language one at a time. This approach is sure to appeal to programmers and system administrators who have urgent problems and a preference for learning by semi-guided experimentation.


Posted By

buscarini on 07/13/06


Tagged

ficheros directorios


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

anayhk


Listar directorio


Published in: Python 


Hay que tabular la parte de dentro del for (aquĆ­ en la web no puedo)

  1. import os
  2. import os.path
  3.  
  4. # Listar entradas y meterlas en "files"
  5. files = os.listdir()
  6. for file in files:
  7.  
  8. # Si es un directorio
  9. if (os.path.isdir(file)):

Report this snippet 

You need to login to post a comment.