Python Function Reference

open
Open file and return a corresponding file object.
Python 3.13
open(file, mode='r', ...)
file
Path to the file or a file descriptor.
mode
File open mode (r, w, a, etc.).
Examples
Python 3.13
>>> with open('file.txt', 'w') as f:
...     f.write('hello')
<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>