choose random file from directory

Solutions on MaxInterview for choose random file from directory by the best coders in the world

showing results for - "choose random file from directory"
Ravi
28 May 2017
1import os, random
2random.choice(os.listdir("C:\\")) #change dir name to whatever
3
queries leading to this page
python pick random file from directorypython select random file in directoryos choose random file from directory pythonselect random file in folder pythonpython choose random file from directoryrandom sample from directory pythonselect random file in directory pythonselect random file from folder pythonpick random files from folder pythonhow to select a random file in a folder pythonpython random filespython random pick random filechoose random filespython select random file from folderget random files from directory pythonpython select random directoryhow to randombly choose file from folder pythonpython random select fileselect random file from dir with repition pythonpython select random file in folderchoose random files pythonget random file from directory pythonhow to open a random file from a folder pythonpick random file from directory pythonget a random file from directory pythonpython get a random file in folderpython select random file from directorypython pick random file from folderselect random file from directory pythonselect random file from dir with repitiondirectory random filenamepython random pick random file from directorypython get random file from directorypython open random file from folderpython random in a directoryget random dir path pythonhow to select a random file from a folder pythonpython choose a random fileselect random files from folder pythonselect random files from a directory pythonrandom file from directory pythonchoose random file from directory