Can anyone tell me why I get this error? The file is in the folder.
import os
with open("C:\\Users\\42077\\Desktop\\test\\vystup\\!output.txt", "a")as f:
for root, dirs, files in os.walk("C:\\Users\\42077\\Desktop\\test\\"):
for path in files:
if path.endswith(".txt"):
with open(path, 'r') as file:
data = file.readlines()
f.write("{0} {1}\n".format(data[2], path))