Most efficient/fastest way to get a single file from a directory
问题 What is the most efficient and fastest way to get a single file from a directory using Python? More details on my specific problem: I have a directory containing a lot of pregenerated files, and I just want to pick a random one. Since I know that there's no really efficient way of picking a random file from a directory other than listing all the files first, my files are generated with an already random name, thus they are already randomly sorted, and I just need to pick the first file from