enter image description hereI am trying to open a basic file.txt
file which is located in the same CWD
as my python interpreter.
So I do a=open("file.txt","r")
Then I want to display its content (there's only one test line like hello world
in it)
So I do content=a.read()
So you know, when I put a
enter, I have this:
a
<_io.TextIOWrapper name='fichier.txt' mode='r' encoding='UTF-8'>
Then I have an error I don't understand. Does someone have an idea on how to fix this ?
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
contenu=a.read()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc6 in position 15: invalid continuation byte