This is also the default mode in which file is opened. If the file does not exists, raises I/O error. The handle is positioned at the beginning of the file. File handle is like a cursor, which defines from where the data has to be read or written in the file. These modes also define the location of the File Handle in the file. It refers to how the file will be used once its opened. In this article, we will be focusing on opening, closing, reading and writing data in a text file.Īccess modes govern the type of operations possible in the opened file.
There are two types of files that can be handled in python, normal text files and binary files (written in binary language,0s and 1s). Python provides inbuilt functions for creating, writing and reading files.
ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.