import random, os
path = r"C:UsersGDesktopscientific-programming-2014-masterscientific-programming-2014-masterhomeworkassignment_3cifar-10-pythoncifar-10-batches-py"
random_filename = random.choice([
x for x in os.listdir(path)
if os.path.isfile(os.path.join(path, x))
])
print(random_filename)