Hello,
the task is to mix lines in text files with the same name in different folders, for example c: \ Users \ i \ 200818comments.txt where i = 1 ... n
import random for i in range(1, 10): filename = 'c:\\Users\\i\\200818comments.txt' f = open(filename) lines = f.readlines() f.close() random.shuffle(lines) f = open(filename,'w') f.writelines(lines) f.close() Unfortunately, this approach does not work: [Errno 2] No such file or directory Please tell me how to solve the issue