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

Re: [Tutor] list packing

2006-02-27 Thread Kent Johnson
Sean Perry wrote: > os.path.join() is self-documenting. I find this to be a better reason to > use it than anything else. But then my code only ever runs on Unix of > some flavor. I'm not sure why you put in the comment about Unix - os.path.join() is the recommended way of joining paths portabl

Re: [Tutor] list packing

2006-02-27 Thread kevin parks
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 comprehensions twist my brain b

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/') i

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

[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 sometime