/ Published in: Python
URL: http://stackoverflow.com/questions/701402/best-way-to-choose-a-random-file-from-a-directory
Expand |
Embed | Plain Text
import os, random random.choice(os.listdir("C:\\")) #change dir name to whatever
You need to login to post a comment.
