1
I want to open a. txt file for reading but python always gives error, want to use
f = open('ficheiro.txt', "r")
or
f =open('C:\...(diretório)...\ficheiro.txt', "r")
I’ve already created files from python to know where they are stored and put the file I want there, and it still doesn’t work. It only works when I copy the content I want to the file I create with python, but it’s a lot of work.
Python always raises this error:
IOError: [Errno 2] No such file or directory: 'ficheiro.txt'
What can I do to solve the problem?
The ideal would be that Voce put the real code (Ctrl-c, Ctrl-v) and the error message in the body of your question, the way you wrote it was very comprehensive, difficult to understand what the problem is.
– Sidon