Re: [Tutor] Getting os.walk output into a list :p:

2013-03-15 Thread Paradox
On 03/15/2013 02:31 PM, Dave Angel wrote: On 03/15/2013 01:53 AM, Paradox wrote: There is something I can't figure out about the following code (using python 2.7.3): def return_tree_files(rootpath, pattern): for root, dirs, files in os.walk(rootpath): i = [os.path.join(root, fi

Re: [Tutor] Getting os.walk output into a list

2013-03-14 Thread Dave Angel
On 03/15/2013 01:53 AM, Paradox wrote: There is something I can't figure out about the following code (using python 2.7.3): def return_tree_files(rootpath, pattern): for root, dirs, files in os.walk(rootpath): i = [os.path.join(root, filename) for filename in fnmatch.filter(files,

[Tutor] Getting os.walk output into a list

2013-03-14 Thread Paradox
There is something I can't figure out about the following code (using python 2.7.3): def return_tree_files(rootpath, pattern): for root, dirs, files in os.walk(rootpath): i = [os.path.join(root, filename) for filename in fnmatch.filter(files, pattern)] return i I thought th