Re: [Tutor] list packing

2006-02-27 Thread Kent Johnson
kevin parks wrote: John, Thanks... i am liking this variation a tad more since it means i only have to type the path in one place but it is akin to your second one... i was (still am really) having a hard time understanding how to apply path.join _and_ listdir sometimes list

[Tutor] list packing

2006-02-26 Thread kevin parks
howdy, I am using the os module to do some of my heavy lifting for me. I am tried of building lists by hand so i decided that i would get python to look in a bunch of directories and stuff all the things it find there into a list depending on it's extension. Works great ... one problem

Re: [Tutor] list packing

2006-02-26 Thread John Fouhy
On 27/02/06, kevin parks [EMAIL PROTECTED] wrote: snd = [f for f in os.listdir('/Users/kevin/snd/') if f.endswith('.aif')] If this is all you need, then you could do something like: snd = ['/Users/kevin/snd/%s' % f for f in os.listdir('/Users/kevin/snd/') if f.endswith('.aif')] Or, slightly

Re: [Tutor] list packing

2006-02-26 Thread Sean Perry
John Fouhy wrote: On 27/02/06, kevin parks [EMAIL PROTECTED] wrote: snd = [f for f in os.listdir('/Users/kevin/snd/') if f.endswith('.aif')] If this is all you need, then you could do something like: snd = ['/Users/kevin/snd/%s' % f for f in os.listdir('/Users/kevin/snd/') if