Mike Meyer wrote: > darren kirby <[EMAIL PROTECTED]> writes: > >>If all you want is filenames this will work: >> >>>>>import glob >>>>>files = ["%s" % f for f in glob.glob("*")] > > > What's the point of doing "%s" % f? How is this different from just > file = [f for f in glob.glob("*")]?
Answering narrowly, the difference is that using "%s" calls str() on the items in the result list, while your suggestion does not. ("Why not just use str(f) instead of the less clear '%s' % f?" would be a valid question too though.) -Peter -- http://mail.python.org/mailman/listinfo/python-list