[OT] Re: output from external commands

Bengt Richter bokr at oz.net
Tue Oct 25 20:53:06 EDT 2005


On Tue, 25 Oct 2005 10:10:39 -0500, Terry Hancock <hancock at anansispaceworks.com> wrote:

>On Monday 24 October 2005 09:04 pm, darren kirby wrote:
>> quoth the Fredrik Lundh:
>> > (using either on the output from glob.glob is just plain silly, of course)
>> 
>> Silly? Sure. os.listdir() is more on point. Never said I was the smartest. 
>> However, I will defend my post by pointing out that at the time it was the 
>> only one that actually included code that did what the OP wanted.
>
>I think Mr. Lundh's point was only that the output from glob.glob is already
>guaranteed to be strings, so using either '%s'%f or str(f) is superfluous.
>
And so is a listcomp that only reproduces the list returned by glob.glob
-- especially by iterating through that same returned list ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list