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 f.endswith('.aif')]
> 
> Or, slightly more robustly (?),
> 
> snd = [os.path.join('/Users/kevin/snd', f) for f in
> os.listdir('/Users/kevin/snd/') if f.endswith('.aif')]
> 

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.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to