readfile - No such file or directory while trying to read files in a directory python -
I have this code that lists the files in the directory and parses with each of my functions. I am getting the error as: parse_file (f)): This error shows that it has I also tried to transfer files to a file in my desktop and the script was working fine. What is the problem I do not understand is I am very new to the dragon, so please forgive me if its dumb question. Thanks!
File "find.py", line 21, & lt; Module & gt; I: Error: [Aron 2] There is no such file or directory: 'file.txt'
file.txt because it Is present in the folder that I have specified in
os.listdir , I have many files if I delete
file.txt on a separate file Will show the error.
os.listdir () returns filename , no way. To create a full path, join them with the directory name: For file name in OSLID (path):
path = r "C: \ Program Files (x86) \ folder \ folder" (OS F. as: .path.join (path, file name)):
Comments
Post a Comment