fredrik at pythonware.com
Wed Jul 23 14:26:39 CEST 2008
>> if you want a list of files from a single directory, use listdir, not walk:
>> >>> import os, random
>> >>> random.choice(os.listdir("/"))
> This will include folders as well, though, which isn't what the OP
> asked for.
as illustrated by my example (cut and pasted from a windows machine). oops.
isn't that bad, though.
More information about the Python-list