FileNotFoundError: [Errno 2] No such file or directory: 'file1.txt'

Viewed 44
with open('file1.txt', 'r', encoding='utf-8') as x, open('file2.txt', 'r', encoding='utf-8') as y:

My code is in the same directory as the files. How come I am getting this error?

1 Answers

In my case it works. You can print os.getcwd() just to be sure.

Related