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. Recall I wrote: "If all you want is filenames this will work:" not: "This is how you should do it" And I invite you to prove me wrong ... it does work. As a novice, I do appreciate getting set strait when I code something dumb, but going off about the efficiency of "%s % foo" over "str(foo)" hardly helps the OP, and is not very pertinant to my glob faux pas either. An explanation of why glob is silly would perhaps teach me better than just stating it as fact. It is things like this that make me wary of posting to this list, either to help another, or with my own q's. All I usually want is help with a specific problem, not a critique involving how brain-dead my code is. I'm a beginner, of course my code is going to be brain-dead ;) I thought the idea was "make it work first, then optimize"? In any event, I will refrain from trying to help people here until I get over this silly stage I seem to be stuck in... it just doesn't seem worth it. I am not trying to sound like a whiner here, I just wish you experts would go easy on us novices... -d -- darren kirby :: Part of the problem since 1976 :: http://badcomputer.org "...the number of UNIX installations has grown to 10, with more expected..." - Dennis Ritchie and Ken Thompson, June 1972
pgprtsZtFVPaz.pgp
Description: PGP signature
-- http://mail.python.org/mailman/listinfo/python-list