it seems that we cant shuffle items of a directory with random.sample . because we should write : a=random.sample(source_directory, len(source_directory))
after this we need to split data so we write :
for file in os.scandir(a):
size=os.path.getsize(file)
if size == 0 :
print(f"{file.name} is zero length, so ignoring.")
os.remove(file.path)
but it gives eror about the for loop
how we can shuffle items in directory?
]