Last Updated: May 22, 2026
When open() returns, you get back a file object: a Python wrapper around the operating system's file descriptor. This lesson looks at the file object itself, the full set of methods you can call on it (seek, tell, truncate, flush, close, fileno), the attributes it exposes (name, mode, closed, encoding), and the situations where you need them, with random-access on binary files as the main use case.