Answers for "how to select a random file in a folder python"

1

random pick any file from directory python

import os, random
random.choice(os.listdir("C:\\")) #change dir name to whatever
Posted by: Guest on January-14-2021

Code answers related to "how to select a random file in a folder python"

Python Answers by Framework

Browse Popular Code Answers by Language