ls files --> list packer
Magnus Lycka
lycka at carmen.se
Fri Feb 24 05:45:04 EST 2006
kpp9c wrote:
> that other sillyness i mentioned is not strickly required ... just
> dreaming but i know involves some kind of os walk type thing prolly ...
os.walk isn't exactly rocket science... Something similar to this?
>>> import os
>>> for dir, dirs, files in os.walk('.'):
... txt_files = [x for x in files if x.endswith('.txt')]
... if txt_files:
... print dir, txt_files
More information about the Python-list
mailing list