guys. I\'m trying to find the most elegant solution to a problem and wondered if python has anything built-in for what I\'m trying to do.
What I\'m doing is this. I
You could try itertools.chain(), like this:
itertools.chain()
import itertools import os dirs = ["c:\\usr", "c:\\temp"] subs = list(itertools.chain(*[os.listdir(d) for d in dirs])) print subs
itertools.chain() returns an iterator, hence the passing to list().
list()