📅  最后修改于: 2022-03-11 14:59:38.694000             🧑  作者: Mango
import os
import random
import dircache
dir = 'some/directory'
filename = random.choice(dircache.listdir(dir))
path = os.path.join(dir, filename)