Re: [Tutor] Walking a directory

2005-01-17 Thread Jacob S.
Kent's suggestions are always my favorites, along with others, c. --nevermind To get the full path in your list-- change Kent's to this import os filelist = [] for root,directories,filenames in os.walk("Aircraft"): for filename in filenames: if filename.endswith("-set.xml"):

Re: [Tutor] Walking a directory

2005-01-17 Thread Kent Johnson
Something like this (not tested!): import os for dirpath, dirnames, filenames in os.walk('Aircraft'): for filename in filenames: if filename.endswith('-set.xml'): print filename[:-8] This is probably a good time to mention Jason Orendorff's wonderful path module, which makes

[Tutor] Walking a directory

2005-01-17 Thread Arthur Wiebe
What I want to do is rather simple, but I cannot find any good documentation for something like this. The directory structure is sort of like this: >Aircraft >>A-10 +A-10cl-set.xml +A-10fg-set.xml For example Aircraft/A-10/A-10cl-set.xml Now I want to loop though each aircrafts folder (such as A