0

I read that tr mode is a default mode when you use open() function. But I noticed that if I will write in PyCharm this

file = open("error.txt")
print(file)

than it will return <_io.TextIOWrapper name='error.txt' mode='r' encoding='UTF-8'> I really can't understand what is the default mode: r or tr? And what is the difference?

Nataliia
  • 45
  • 4
  • 3
    I think this is answered here: https://stackoverflow.com/questions/23051062/open-files-in-rt-and-wt-modes – Evan Summers Sep 19 '22 at 07:44
  • [_"The default mode is `'r'` (open for reading text, **a synonym** of `'rt'`)."_](https://docs.python.org/3/library/functions.html#open) – jonrsharpe Sep 19 '22 at 07:45

0 Answers0